This repository has been archived by the owner on Apr 10, 2024. It is now read-only.
generated from techno-dwarf-works/unity-package-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from techno-dwarf-works/feature/clean-up
Clean Up
- Loading branch information
Showing
53 changed files
with
412 additions
and
1,151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
Assets/BetterEditorTools/Editor/EditorTools/Comparers/SerializedPropertyComparer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
Assets/BetterEditorTools/Editor/EditorTools/ComponentExtension.cs
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
Assets/BetterEditorTools/Editor/EditorTools/ComponentExtension.cs.meta
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
Assets/BetterEditorTools/Editor/EditorTools/Drawers/Base/HeightCacheValue.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
using System; | ||
using Better.EditorTools.Helpers.Caching; | ||
using Better.Extensions.Runtime; | ||
using UnityEngine; | ||
|
||
namespace Better.EditorTools.Drawers.Base | ||
{ | ||
public class HeightCacheValue : CacheValue<float> | ||
{ | ||
public bool Forced { get; private set; } | ||
|
||
public HeightCacheValue(bool additional, float height) | ||
{ | ||
IsValid = additional; | ||
Value = height; | ||
} | ||
|
||
public HeightCacheValue() | ||
{ | ||
} | ||
|
||
public HeightCacheValue Force() | ||
{ | ||
Forced = true; | ||
return this; | ||
} | ||
|
||
public static HeightCacheValue GetAdditive(float height) | ||
{ | ||
var cache = new HeightCacheValue(true, height); | ||
return cache; | ||
} | ||
|
||
public static HeightCacheValue GetFull(float height) | ||
{ | ||
var cache = new HeightCacheValue(false, height); | ||
return cache; | ||
} | ||
|
||
public static HeightCacheValue operator +(HeightCacheValue left, HeightCacheValue right) | ||
{ | ||
if (left == null) | ||
{ | ||
DebugUtility.LogException<ArgumentNullException>(nameof(left)); | ||
return new HeightCacheValue(false, 0); | ||
} | ||
|
||
if (right == null) | ||
{ | ||
DebugUtility.LogException<ArgumentNullException>(nameof(right)); | ||
return new HeightCacheValue(false, 0); | ||
} | ||
|
||
if (left.Forced) | ||
{ | ||
return left; | ||
} | ||
|
||
if (right.Forced) | ||
{ | ||
return right; | ||
} | ||
|
||
if (!left.IsValid && !right.IsValid) | ||
{ | ||
return GetFull(Mathf.Max(left.Value, right.Value)); | ||
} | ||
|
||
if ((!left.IsValid && right.IsValid) || (left.IsValid && !right.IsValid)) | ||
{ | ||
return GetFull(left.Value + right.Value); | ||
} | ||
|
||
if (left.IsValid && right.IsValid) | ||
{ | ||
return GetAdditive(left.Value + right.Value); | ||
} | ||
|
||
return GetAdditive(0); | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Assets/BetterEditorTools/Editor/EditorTools/Drawers/Base/HeightCacheValue.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.