diff --git a/Editor.meta b/Editor.meta index 97d8472..26a7ffc 100644 --- a/Editor.meta +++ b/Editor.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a6ae0caf9675b5c4e88e6ca41ca0d3af +guid: ff0dcc3c0bdb6f34cb6fdeeca979933f folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Editor/BetterAttributes.Editor.asmdef b/Editor/BetterAttributes.Editor.asmdef index d911bf3..2268e44 100644 --- a/Editor/BetterAttributes.Editor.asmdef +++ b/Editor/BetterAttributes.Editor.asmdef @@ -2,7 +2,7 @@ "name": "BetterAttributes.Editor", "rootNamespace": "", "references": [ - "GUID:618e123b521db74429ef44b837b020b0" + "GUID:35101f455c979e94c9a0a4793484b7fd" ], "includePlatforms": [ "Editor" diff --git a/Editor/BetterAttributes.Editor.asmdef.meta b/Editor/BetterAttributes.Editor.asmdef.meta index 780439b..ffbf4f4 100644 --- a/Editor/BetterAttributes.Editor.asmdef.meta +++ b/Editor/BetterAttributes.Editor.asmdef.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9300ec3f935368f4cbad66a991f13724 +guid: b6053aaf850e1f44ebbe8a655121831f AssemblyDefinitionImporter: externalObjects: {} userData: diff --git a/Editor/EditorAddons.meta b/Editor/EditorAddons.meta index 251672f..e535a52 100644 --- a/Editor/EditorAddons.meta +++ b/Editor/EditorAddons.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: b74a554b61b64bb2bc82e5d47b57b922 +guid: 2723479bb55b0c147952fbbce94104cb timeCreated: 1660519157 \ No newline at end of file diff --git a/Editor/EditorAddons/BetterAttributesEditor.cs.meta b/Editor/EditorAddons/BetterAttributesEditor.cs.meta index 68f4003..374a57e 100644 --- a/Editor/EditorAddons/BetterAttributesEditor.cs.meta +++ b/Editor/EditorAddons/BetterAttributesEditor.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 87a1a355d22a45448c03961c1750db58 +guid: 20f290ac9e7e12c47bbd79e0db963b19 timeCreated: 1656879186 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers.meta b/Editor/EditorAddons/Drawers.meta index e61c3c9..917593d 100644 --- a/Editor/EditorAddons/Drawers.meta +++ b/Editor/EditorAddons/Drawers.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d90f059114b53c14bbbafb8253a0c639 +guid: c7b3ee0692f058e44ae1b3acaa3db300 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Editor/EditorAddons/Drawers/Base.meta b/Editor/EditorAddons/Drawers/Base.meta index fff11c2..3c0903d 100644 --- a/Editor/EditorAddons/Drawers/Base.meta +++ b/Editor/EditorAddons/Drawers/Base.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 6400fb9169024b8abc3d781f87c1d975 +guid: 14fefd7b45208a0428df150aa6f7530a timeCreated: 1663074030 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Base/Comparers.cs b/Editor/EditorAddons/Drawers/Base/Comparers.cs new file mode 100644 index 0000000..1ce780c --- /dev/null +++ b/Editor/EditorAddons/Drawers/Base/Comparers.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using UnityEditor; + +namespace BetterAttributes.EditorAddons.Drawers.Base +{ + public abstract class BaseComparer where T : IEqualityComparer, new() + { + public static T Instance { get; } = new T(); + } + + public class TypeComparer : BaseComparer, IEqualityComparer + { + public bool Equals(Type x, Type y) + { + if (ReferenceEquals(x, y)) return true; + if (ReferenceEquals(x, null)) return false; + if (ReferenceEquals(y, null)) return false; + if (x.IsAssignableFrom(y) || x == y) return true; + return (y.IsInterface || y.IsAbstract) && x == typeof(Type); + } + + public int GetHashCode(Type obj) + { + return 0; + } + } + + public class AssignableFromComparer : BaseComparer, IEqualityComparer + { + public bool Equals(Type x, Type y) + { + if (ReferenceEquals(x, y)) return true; + if (ReferenceEquals(x, null)) return false; + if (ReferenceEquals(y, null)) return false; + var isAssignableFrom = x.IsAssignableFrom(y); + return isAssignableFrom || x == y; + } + + public int GetHashCode(Type obj) + { + return 0; + } + } + + public class SerializedPropertyComparer : BaseComparer, IEqualityComparer + { + public bool Equals(SerializedProperty x, SerializedProperty y) + { + if (ReferenceEquals(x, y)) return true; + if (ReferenceEquals(x, null)) return false; + if (ReferenceEquals(y, null)) return false; + if (x.GetType() != y.GetType()) return false; + return x.propertyPath == y.propertyPath; + } + + public int GetHashCode(SerializedProperty obj) + { + return (obj.propertyPath != null ? obj.propertyPath.GetHashCode() : 0); + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Base/Comparers.cs.meta b/Editor/EditorAddons/Drawers/Base/Comparers.cs.meta new file mode 100644 index 0000000..bd6c61c --- /dev/null +++ b/Editor/EditorAddons/Drawers/Base/Comparers.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 565e62b914374ffcbf1fd257414b8a60 +timeCreated: 1665894675 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Base/FieldDrawer.cs.meta b/Editor/EditorAddons/Drawers/Base/FieldDrawer.cs.meta index bbd24b7..bd6b86f 100644 --- a/Editor/EditorAddons/Drawers/Base/FieldDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/Base/FieldDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: d3933348bcd446d3af214c98a9022715 +guid: 80a57780bb9ff23448eb9da2bae00a83 timeCreated: 1663074898 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs b/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs index 26ff9d1..3946e49 100644 --- a/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs +++ b/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs @@ -1,4 +1,5 @@ -using BetterAttributes.EditorAddons.Drawers.Utilities; +using System; +using BetterAttributes.EditorAddons.Drawers.Utilities; using UnityEditor; using UnityEngine; @@ -16,9 +17,14 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten base.OnGUI(position, property, label); } + private protected virtual Type GetFieldType() + { + return fieldInfo.FieldType; + } + private protected bool ValidateCachedProperties(SerializedProperty property, BaseUtility handler) where THandler : new() { - var fieldType = fieldInfo.FieldType; + var fieldType = GetFieldType(); var contains = _wrappers.ContainsKey(property); if (contains) { @@ -27,7 +33,7 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten else { var gizmoWrapper = handler.GetUtilityWrapper(fieldType, attribute.GetType()); - _wrappers.Add(property, (gizmoWrapper, fieldType)); + _wrappers.Add(property, new WrapperCollectionValue(gizmoWrapper, fieldType)); } return contains; diff --git a/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs.meta b/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs.meta index 77f1eb7..6fd44c2 100644 --- a/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: ceac65de11554def8476a27370ad905c +guid: e84ec7387e535494eba1fb184736e949 timeCreated: 1663378765 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs b/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs index f410e42..cd17fe8 100644 --- a/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs +++ b/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs @@ -5,26 +5,21 @@ namespace BetterAttributes.EditorAddons.Drawers.Base { - public class WrapperCollection : Dictionary where T : UtilityWrapper + public class WrapperCollectionValue where T : UtilityWrapper { - private class SerializedPropertyComparer : IEqualityComparer + public WrapperCollectionValue(T wrapper, Type type) { - public bool Equals(SerializedProperty x, SerializedProperty y) - { - if (ReferenceEquals(x, y)) return true; - if (ReferenceEquals(x, null)) return false; - if (ReferenceEquals(y, null)) return false; - if (x.GetType() != y.GetType()) return false; - return x.propertyPath == y.propertyPath; - } - - public int GetHashCode(SerializedProperty obj) - { - return (obj.propertyPath != null ? obj.propertyPath.GetHashCode() : 0); - } + Wrapper = wrapper; + Type = type; } - public WrapperCollection() : base(new SerializedPropertyComparer()) + public T Wrapper { get; } + public Type Type { get; } + } + + public class WrapperCollection : Dictionary> where T : UtilityWrapper + { + public WrapperCollection() : base(SerializedPropertyComparer.Instance) { } @@ -32,7 +27,7 @@ public void Deconstruct() { foreach (var gizmo in Values) { - gizmo.Item1.Deconstruct(); + gizmo.Wrapper.Deconstruct(); } } } diff --git a/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs.meta b/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs.meta index c246d3c..5cff979 100644 --- a/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs.meta +++ b/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: c63e3e97801b44a68d1f4fae647f3a76 +guid: fe3ec4b9288f1b546b6fc7e3e8afaed8 timeCreated: 1663276182 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs b/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs index 79ad8dd..d81ff2e 100644 --- a/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs +++ b/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs @@ -5,6 +5,14 @@ namespace BetterAttributes.EditorAddons.Drawers.Base { public class WrappersTypeCollection : Dictionary> { - + public WrappersTypeCollection() : base() + { + + } + + public WrappersTypeCollection(IEqualityComparer equalityComparer) : base(equalityComparer) + { + + } } } \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs.meta b/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs.meta index e45ff08..f0d89a6 100644 --- a/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs.meta +++ b/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 6cb421450e7b4eecb06ccdd5d2432b74 +guid: a997aa6e54834524a863fb961cf089a8 timeCreated: 1663104305 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Decorators.meta b/Editor/EditorAddons/Drawers/Decorators.meta index d78a772..5a5b5d7 100644 --- a/Editor/EditorAddons/Drawers/Decorators.meta +++ b/Editor/EditorAddons/Drawers/Decorators.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 325cf6e28f6b0a94188ba2cbe886869c +guid: 04e4655c8a5c8d24eaabe0e30685e4bf folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs.meta b/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs.meta index 481f07f..d1078e1 100644 --- a/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 22b6cb6948d54f5bbe39b00b1614b1d3 +guid: 64a67f7a51654ce42a6d03f440f9b2de timeCreated: 1615412215 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs.meta b/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs.meta index f2c45c4..3fc760d 100644 --- a/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: ac6f9b1026b247d28f5adcd1a3c7699d +guid: 32123521c290f43408c8ea980800d659 timeCreated: 1615208046 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs.meta b/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs.meta index 2ea7cd3..1209be3 100644 --- a/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 4fd6b96bb3fa4d8cbeb054dfbb383a81 +guid: 7e3f9c32c859a894d9bf81a83f5ce400 timeCreated: 1615208046 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs.meta b/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs.meta index fc9f61a..864084a 100644 --- a/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: b01d2e89b2d141e68c18f28eb2055609 +guid: 05948c980b372404aa9324e4da1f4d04 timeCreated: 1615208046 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo.meta b/Editor/EditorAddons/Drawers/Gizmo.meta index 6b6e2cb..c514f7a 100644 --- a/Editor/EditorAddons/Drawers/Gizmo.meta +++ b/Editor/EditorAddons/Drawers/Gizmo.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 77f0e5fafb8943518ddde24a4fe5c572 +guid: 8890807caef9ccb40a280c75a5ca62fc timeCreated: 1658860908 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers.meta b/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers.meta index 7164016..49fe016 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 3c21a22ea6ac4f67a1d7942c42c393d1 +guid: f3c4803dca2d276438110209d7242797 timeCreated: 1658880022 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers/BoundsBaseWrapper.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers/BoundsBaseWrapper.cs.meta index feb0baa..775e4dc 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers/BoundsBaseWrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers/BoundsBaseWrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 1c439f4ab4184d4890c276fe5400ddf0 +guid: cf1af38cb749f054eb8c583c25b645c6 timeCreated: 1658879902 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers/GizmoWrapper.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers/GizmoWrapper.cs.meta index 78cd26a..592aee4 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers/GizmoWrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers/GizmoWrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 9e20baab5a784baf9fd1bee50dc2c6de +guid: db61636d913e6bc4ab6a4ce56dfcd915 timeCreated: 1658865058 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs b/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs index 573325b..d272570 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs +++ b/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs @@ -12,12 +12,12 @@ namespace BetterAttributes.EditorAddons.Drawers.Gizmo [CustomPropertyDrawer(typeof(GizmoLocalAttribute))] public class GizmoDrawer : MultiFieldDrawer { - private WrapperCollections.GizmoWrappers Collection + private GizmoWrappers Collection { get { _wrappers ??= GenerateCollection(); - return _wrappers as WrapperCollections.GizmoWrappers; + return _wrappers as GizmoWrappers; } } @@ -59,7 +59,7 @@ private protected override void PostDraw(Rect position, SerializedProperty prope private protected override WrapperCollection GenerateCollection() { - return new WrapperCollections.GizmoWrappers(); + return new GizmoWrappers(); } private protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label) diff --git a/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs.meta index 052cf81..b9eba64 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 10c6c30072374c8fb9b9bd28f49767a3 +guid: 8325591a73a20cb4b9632deacf767ee9 timeCreated: 1658860920 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/HideTransformDrawer.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/HideTransformDrawer.cs.meta index d9c1901..a1c2469 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/HideTransformDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/HideTransformDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 22ce8662a9974f4197209e7f31a210f1 +guid: 95bf26ce9c33e0249b95fc1a7c46dbcf timeCreated: 1659007561 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers.meta b/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers.meta index 10e4524..134f686 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 69cfa7a4340640a586d6f6d1de4b20f0 +guid: 52482c6a2ee32514cb80653471f1db1d timeCreated: 1658873828 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/BoundsLocalWrapper.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/BoundsLocalWrapper.cs.meta index 0d0fc6b..1c0dc84 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/BoundsLocalWrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/BoundsLocalWrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: c24c4252cf274cf298b6977abc0cd3f9 +guid: cf0ecb82c1d3e9444bd5c051ee6e9bd6 timeCreated: 1658874036 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/QuaternionLocalWrapper.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/QuaternionLocalWrapper.cs.meta index c09c89d..519ff4c 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/QuaternionLocalWrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/QuaternionLocalWrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: b92dabab959440a58e12f470def7e532 +guid: 23d14e5ab5f5a8c49af66b5a38cf732e timeCreated: 1658874136 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/Vector2LocalWrapper.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/Vector2LocalWrapper.cs.meta index a733c28..cd90d0a 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/Vector2LocalWrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/Vector2LocalWrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 5728cafd8c1e434484df74ccfacc47ee +guid: cf973ea2a262fde4185dd45988d369e3 timeCreated: 1658874122 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/Vector3LocalWrapper.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/Vector3LocalWrapper.cs.meta index 9845e47..99cf518 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/Vector3LocalWrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/LocalWrappers/Vector3LocalWrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 61989ad7be7247f7bf709f4c4f94b2ce +guid: 480b41c6b59c28e4d801e2307d2985f7 timeCreated: 1658874052 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers.meta b/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers.meta index 6438358..6a061db 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: d57aa09bd4ed4b05a24902f1a43abf53 +guid: fb96ee0d25bf2744cacef0de39c228c5 timeCreated: 1658873819 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/BoundsWrapper.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/BoundsWrapper.cs.meta index 8161710..3ff890b 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/BoundsWrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/BoundsWrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 0829e6ce680d44ac9dac12cf5244eb5b +guid: 0f0bee4a344b2a047bd9dd0c1bebdb6b timeCreated: 1658865261 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/QuaternionWrapper.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/QuaternionWrapper.cs.meta index 6e626a2..3846e17 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/QuaternionWrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/QuaternionWrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 98cdb67f07a04372b28dadc13d76c25f +guid: 952b68c867ad1d0439d5b65807edb939 timeCreated: 1658865050 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/Vector2Wrapper.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/Vector2Wrapper.cs.meta index 77c7375..4d6acac 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/Vector2Wrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/Vector2Wrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 660e673f42154e80a555a0bf80ee248f +guid: 300bfa2f065bae0408bac9905acc52f5 timeCreated: 1658865231 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/Vector3Wrapper.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/Vector3Wrapper.cs.meta index 45645a9..e1fb673 100644 --- a/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/Vector3Wrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Gizmo/WorldWrappers/Vector3Wrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 642cd63673c5436fa8898068fd7ca0a0 +guid: 147e473ca69e0e84a930e65f16745b28 timeCreated: 1658865058 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Preview.meta b/Editor/EditorAddons/Drawers/Preview.meta index 254c4ce..77cf4e7 100644 --- a/Editor/EditorAddons/Drawers/Preview.meta +++ b/Editor/EditorAddons/Drawers/Preview.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 83f20dd5de0147c7a9c6cae4b7ace47f +guid: c5c4704f2bb53ea4b8cad29ea3fe616f timeCreated: 1663026494 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Preview/BaseWrappers.meta b/Editor/EditorAddons/Drawers/Preview/BaseWrappers.meta index bfd0306..1844aa8 100644 --- a/Editor/EditorAddons/Drawers/Preview/BaseWrappers.meta +++ b/Editor/EditorAddons/Drawers/Preview/BaseWrappers.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: a88c5366fbaf4e85b573789e539c88b6 +guid: d34337b69b583a54e8c7b461bee475ff timeCreated: 1663114542 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Preview/BaseWrappers/BasePreviewWrapper.cs.meta b/Editor/EditorAddons/Drawers/Preview/BaseWrappers/BasePreviewWrapper.cs.meta index f16b638..e8edbed 100644 --- a/Editor/EditorAddons/Drawers/Preview/BaseWrappers/BasePreviewWrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Preview/BaseWrappers/BasePreviewWrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: f3ea4f54d1364d079635d5f895ff138b +guid: 4e9f3a9e3b6121a438c1fb8a697ab2bc timeCreated: 1663114499 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Preview/BaseWrappers/PreviewWrapper.cs.meta b/Editor/EditorAddons/Drawers/Preview/BaseWrappers/PreviewWrapper.cs.meta index cef094a..4020e23 100644 --- a/Editor/EditorAddons/Drawers/Preview/BaseWrappers/PreviewWrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Preview/BaseWrappers/PreviewWrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 95188c30707846d68c589e5784faa551 +guid: 582f28c17ac4bc440b53e69498b82c9a timeCreated: 1663112259 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Preview/PopupWrappers.meta b/Editor/EditorAddons/Drawers/Preview/PopupWrappers.meta index b3798a0..12b83f5 100644 --- a/Editor/EditorAddons/Drawers/Preview/PopupWrappers.meta +++ b/Editor/EditorAddons/Drawers/Preview/PopupWrappers.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: c1674f972c9f471ca870ce29d1345d6c +guid: 93d02b020d2c11f4780c40458f219140 timeCreated: 1663114563 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Preview/PopupWrappers/AssetWrapper.cs.meta b/Editor/EditorAddons/Drawers/Preview/PopupWrappers/AssetWrapper.cs.meta index 9c16e9b..323c700 100644 --- a/Editor/EditorAddons/Drawers/Preview/PopupWrappers/AssetWrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Preview/PopupWrappers/AssetWrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: edbd189c31d8446bbe30f993c7f20def +guid: 3770801c883b86744b045a31811a6a53 timeCreated: 1663114898 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Preview/PopupWrappers/SpriteWrapper.cs.meta b/Editor/EditorAddons/Drawers/Preview/PopupWrappers/SpriteWrapper.cs.meta index 62c1b48..c300991 100644 --- a/Editor/EditorAddons/Drawers/Preview/PopupWrappers/SpriteWrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Preview/PopupWrappers/SpriteWrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 13101d3b412e4f079a7a35ff428a96cc +guid: 353b4f6598054cf40b53ed02282578d4 timeCreated: 1663114504 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Preview/PopupWrappers/TextureWrapper.cs.meta b/Editor/EditorAddons/Drawers/Preview/PopupWrappers/TextureWrapper.cs.meta index 14bdc19..566b517 100644 --- a/Editor/EditorAddons/Drawers/Preview/PopupWrappers/TextureWrapper.cs.meta +++ b/Editor/EditorAddons/Drawers/Preview/PopupWrappers/TextureWrapper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: a23e02d965c842e99ae997ed19f94e58 +guid: 6c8b7bfbefdc8e84281c75346ca6a356 timeCreated: 1663114504 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs.meta b/Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs.meta index 70f9389..7b21e4f 100644 --- a/Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 99763335c35d4c71b45dd366310ad5db +guid: d6253d1ce8dbb95449d4a42760aea89e timeCreated: 1663026510 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Preview/PreviewSceneRenderer.cs.meta b/Editor/EditorAddons/Drawers/Preview/PreviewSceneRenderer.cs.meta index 8722636..b71c1e3 100644 --- a/Editor/EditorAddons/Drawers/Preview/PreviewSceneRenderer.cs.meta +++ b/Editor/EditorAddons/Drawers/Preview/PreviewSceneRenderer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 967dac8ba64049f9b856343511bb58ae +guid: aebc94c9046cea149bb81b0be4a21203 timeCreated: 1663343056 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/ReadOnly.meta b/Editor/EditorAddons/Drawers/ReadOnly.meta index 8d6e06e..bde7b2e 100644 --- a/Editor/EditorAddons/Drawers/ReadOnly.meta +++ b/Editor/EditorAddons/Drawers/ReadOnly.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 63dea932e6e1498f86d627cb309a85cf +guid: 8f2e1886d09f3d4438a4035b4d1d32a7 timeCreated: 1658861788 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/ReadOnly/ReadOnlyFieldDrawer.cs.meta b/Editor/EditorAddons/Drawers/ReadOnly/ReadOnlyFieldDrawer.cs.meta index 6757827..ceef749 100644 --- a/Editor/EditorAddons/Drawers/ReadOnly/ReadOnlyFieldDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/ReadOnly/ReadOnlyFieldDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: bec9abd6c403483b837a996bcc26604e +guid: d2504b097c6b2434da2ddee356e14bbb timeCreated: 1657919397 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Rename.meta b/Editor/EditorAddons/Drawers/Rename.meta index d06281c..bf1447a 100644 --- a/Editor/EditorAddons/Drawers/Rename.meta +++ b/Editor/EditorAddons/Drawers/Rename.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: f25ad0ea550c4d98938bbd4ce9946a98 +guid: bbea82df2560ae344864f8be74018ce8 timeCreated: 1663538163 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Rename/RenameFieldDrawer.cs.meta b/Editor/EditorAddons/Drawers/Rename/RenameFieldDrawer.cs.meta index 6577ba1..6eea068 100644 --- a/Editor/EditorAddons/Drawers/Rename/RenameFieldDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/Rename/RenameFieldDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 1bb5929205544b1585ecd33ffc81e7aa +guid: 4a2a5689e85dae642b63dc670dd96d8c timeCreated: 1663538281 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Select.meta b/Editor/EditorAddons/Drawers/Select.meta index d7c4a65..556aee0 100644 --- a/Editor/EditorAddons/Drawers/Select.meta +++ b/Editor/EditorAddons/Drawers/Select.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1827990d9225e53498cd530b446c8387 +guid: 9b5cad4985e78db4ea2d0d9cb53a42f3 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Editor/EditorAddons/Drawers/Select/EnumExtensions.cs b/Editor/EditorAddons/Drawers/Select/EnumExtensions.cs index 0faf176..9366d03 100644 --- a/Editor/EditorAddons/Drawers/Select/EnumExtensions.cs +++ b/Editor/EditorAddons/Drawers/Select/EnumExtensions.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Reflection; namespace BetterAttributes.EditorAddons.Drawers.Select @@ -17,23 +18,32 @@ public static int ToFlagInt(this Enum a) public static bool IsFlagAll(this Enum eEnum) { - return Equals(eEnum, eEnum.GetType().AllFlags()); + return Equals(eEnum, eEnum.GetType().EverythingFlag()); + } + + public static List GetAllValues(this Type enumType) + { + var list = new List(); + var enumValues = Enum.GetValues(enumType); + foreach (var value in enumValues) + { + var v = ((Enum)value).ToFlagInt(); + list.Add(v); + } + + return list; } public static bool IsFlagNone(this Enum eEnum) { - return eEnum.ToFlagInt() == 0; + return eEnum.ToFlagInt() == FlagNone; } - public static Enum AllFlags(this Type enumType) + public static Enum EverythingFlag(this Type enumType) { - if (!enumType.IsEnum) + if (!ValidateEnum(enumType, out var exception)) { - if (enumType.GetCustomAttribute() == null) - { - throw new Exception($"{enumType.Name} must have {nameof(FlagsAttribute)}"); - } - throw new Exception("Type must be Enum"); + throw exception; } long newValue = 0; @@ -48,7 +58,24 @@ public static Enum AllFlags(this Type enumType) } return (Enum)Enum.ToObject(enumType , newValue); } - + + private static bool ValidateEnum(Type enumType, out Exception exception) + { + if (!enumType.IsEnum) + { + if (enumType.GetCustomAttribute() == null) + { + exception = new Exception($"{enumType.Name} must have {nameof(FlagsAttribute)}"); + } + + exception = new Exception("Type must be Enum"); + return false; + } + + exception = null; + return true; + } + public static Enum Add(this Enum type, Enum value) { return (Enum)Enum.ToObject(type.GetType(), type.ToFlagInt() | value.ToFlagInt()); } diff --git a/Editor/EditorAddons/Drawers/Select/EnumExtensions.cs.meta b/Editor/EditorAddons/Drawers/Select/EnumExtensions.cs.meta index 46794a2..2884f57 100644 --- a/Editor/EditorAddons/Drawers/Select/EnumExtensions.cs.meta +++ b/Editor/EditorAddons/Drawers/Select/EnumExtensions.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 365af478436d4327aaae83708b031f68 +guid: 04d1452960f7f5f4a8f8d1e154e7a5be timeCreated: 1664728286 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Select/SelectDrawerBase.cs b/Editor/EditorAddons/Drawers/Select/SelectDrawerBase.cs index 888628d..05d613d 100644 --- a/Editor/EditorAddons/Drawers/Select/SelectDrawerBase.cs +++ b/Editor/EditorAddons/Drawers/Select/SelectDrawerBase.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using BetterAttributes.EditorAddons.Drawers.Base; +using BetterAttributes.EditorAddons.Drawers.Select.Wrappers; +using BetterAttributes.EditorAddons.Drawers.Utilities; using BetterAttributes.EditorAddons.Helpers; using BetterAttributes.Runtime.Attributes.Select; using UnityEditor; @@ -8,7 +10,29 @@ namespace BetterAttributes.EditorAddons.Drawers.Select { - public abstract class SelectDrawerBase : FieldDrawer where T : SelectAttributeBase + public class SelectedItem + { + public SelectedItem(SerializedProperty property, T data) + { + Property = property; + Data = data; + } + + public SerializedProperty Property { get; } + public T Data { get; } + + public bool Equals(SelectedItem other) + { + return SerializedPropertyComparer.Instance.Equals(Property, other.Property) && Data.Equals(other.Data); + } + + public bool Equals(SelectedItem other) + { + return SerializedPropertyComparer.Instance.Equals(Property, other.Property) && Data.Equals(other.Data); + } + } + + public abstract class SelectDrawerBase : MultiFieldDrawer where TAttribute : SelectAttributeBase where TWrapper : BaseSelectWrapper { private bool _needUpdate; private bool _isSetUp; @@ -21,18 +45,28 @@ public override float GetPropertyHeight(SerializedProperty property, GUIContent { return EditorGUI.GetPropertyHeight(property, true); } - + + private protected override Type GetFieldType() + { + return (attribute as SelectAttributeBase)?.GetFieldType() ?? fieldInfo.FieldType; + } + private protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label) { try { + var att = (TAttribute)attribute; if (!CheckSupported(property)) { DrawersHelper.NotSupportedAttribute(property.displayName, fieldInfo.FieldType, attribute.GetType()); return false; } - var att = (T)attribute; + if (!ValidateCachedProperties(property, SelectUtility.Instance)) + { + _wrappers[property].Wrapper.SetProperty(property); + } + var popupPosition = GetPopupPosition(position); if (!_isSetUp) { @@ -41,10 +75,11 @@ private protected override bool PreDraw(ref Rect position, SerializedProperty pr _displayGrouping = att.DisplayGrouping; SetReady(); } + var referenceValue = GetCurrentValue(property); if (DrawButton(popupPosition, referenceValue)) { - ShowDropDown(popupPosition, referenceValue); + ShowDropDown(property, popupPosition, referenceValue); } if (_needUpdate) @@ -75,7 +110,7 @@ private protected override void Deconstruct() { DropdownWindow.CloseInstance(); } - + private bool DrawButton(Rect buttonPosition, object currentValue) { var content = DrawersHelper.GetIconGUIContent(IconType.GrayDropdown); @@ -84,17 +119,18 @@ private bool DrawButton(Rect buttonPosition, object currentValue) return GUI.Button(buttonPosition, content, Styles.Button); } - private void ShowDropDown(Rect popupPosition, object currentValue) + private void ShowDropDown(SerializedProperty serializedProperty, Rect popupPosition, object currentValue) { var copy = popupPosition; copy.y += EditorGUIUtility.singleLineHeight; var popup = DropdownWindow.ShowWindow(GUIUtility.GUIToScreenRect(copy), GenerateHeader()); - var items = GenerateItemsTree(currentValue); + var items = GenerateItemsTree(serializedProperty, currentValue); popup.SetItems(items); } - private protected virtual DropdownCollection GenerateItemsTree(object currentValue) + private protected virtual DropdownCollection GenerateItemsTree(SerializedProperty serializedProperty, + object currentValue) { var items = new DropdownCollection(new DropdownSubTree(new GUIContent("Root"))); var collection = GetSelectCollection(); @@ -103,7 +139,8 @@ private protected virtual DropdownCollection GenerateItemsTree(object currentVal foreach (var type in collection) { var guiContent = new GUIContent(ResolveName(type, _displayName)); - var item = new DropdownItem(guiContent, ResolveState(currentValue, type), OnSelectItem, type); + var item = new DropdownItem(guiContent, ResolveState(currentValue, type), OnSelectItem, + new SelectedItem(serializedProperty, type)); items.AddChild(item); } } @@ -112,7 +149,8 @@ private protected virtual DropdownCollection GenerateItemsTree(object currentVal foreach (var type in collection) { var resolveGroupedName = ResolveGroupedName(type, _displayGrouping); - items.AddItem(resolveGroupedName, ResolveState(currentValue, type), OnSelectItem, type); + items.AddItem(resolveGroupedName, ResolveState(currentValue, type), OnSelectItem, + new SelectedItem(serializedProperty, type)); } } @@ -123,7 +161,7 @@ private protected virtual DropdownCollection GenerateItemsTree(object currentVal private protected abstract object GetCurrentValue(SerializedProperty property); private protected abstract bool CheckSupported(SerializedProperty property); private protected abstract string GetButtonName(object currentValue); - private protected abstract void Setup(SerializedProperty property, T currentAttribute); + private protected abstract void Setup(SerializedProperty property, TAttribute currentAttribute); private protected abstract List GetSelectCollection(); private protected abstract string ResolveName(object value, DisplayName displayName); private protected abstract string[] ResolveGroupedName(object value, DisplayGrouping grouping); diff --git a/Editor/EditorAddons/Drawers/Select/SelectDrawerBase.cs.meta b/Editor/EditorAddons/Drawers/Select/SelectDrawerBase.cs.meta index ce70a6b..b2a5df7 100644 --- a/Editor/EditorAddons/Drawers/Select/SelectDrawerBase.cs.meta +++ b/Editor/EditorAddons/Drawers/Select/SelectDrawerBase.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 67e520a4576241e28be459069a966a33 +guid: ad111f49928853647b3225d0f61ec663 timeCreated: 1640208869 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Select/SelectEnumDrawer.cs b/Editor/EditorAddons/Drawers/Select/SelectEnumDrawer.cs index fa8e11c..c8e54cd 100644 --- a/Editor/EditorAddons/Drawers/Select/SelectEnumDrawer.cs +++ b/Editor/EditorAddons/Drawers/Select/SelectEnumDrawer.cs @@ -2,6 +2,9 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using BetterAttributes.EditorAddons.Drawers.Base; +using BetterAttributes.EditorAddons.Drawers.Select.Wrappers; +using BetterAttributes.EditorAddons.Drawers.WrapperCollections; using BetterAttributes.Runtime.Attributes.Select; using UnityEditor; using UnityEngine; @@ -9,14 +12,34 @@ namespace BetterAttributes.EditorAddons.Drawers.Select { [CustomPropertyDrawer(typeof(SelectEnumAttribute))] - public class SelectEnumDrawer : SelectDrawerBase + public class SelectEnumDrawer : SelectDrawerBase { private List _enumValues; private bool _isFlag; - private Enum _enumValue; + private SelectedItem _enumValue; private Type _enumType; - private const string NoneValue = "None"; - private const string EverythingValue = "Everything"; + + private protected SelectEnumWrapperCollection Collection => _wrappers as SelectEnumWrapperCollection; + + private struct PredefinedValues + { + public PredefinedValues(string name, int value) + { + Name = name; + Value = value; + } + + public string Name { get; } + public int Value { get; } + } + + private PredefinedValues None = new PredefinedValues("None", 0); + private PredefinedValues EverythingValue = new PredefinedValues("Everything", -1); + + private protected override WrapperCollection GenerateCollection() + { + return new SelectEnumWrapperCollection(); + } private protected override void DrawField(Rect position, SerializedProperty property, GUIContent label) { @@ -34,93 +57,77 @@ private protected override GUIContent GenerateHeader() return new GUIContent("Options"); } - private protected override string GetButtonName(object currentValue) + private protected override void Setup(SerializedProperty property, SelectEnumAttribute currentAttribute) { + _enumType = fieldInfo.FieldType; + _isFlag = _enumType.GetCustomAttribute() != null; + Collection[property].Wrapper.SetIsFlag(_isFlag); + var ints = _enumType.GetAllValues(); if (_isFlag) { - if (currentValue.ToString().Equals(NoneValue)) + None = new PredefinedValues("None", EnumExtensions.FlagNone); + if (!ints.Contains(None.Value)) { - return NoneValue; + ints.Insert(0, None.Value); } - if (currentValue.ToString().Equals(EverythingValue)) + var everything = _enumType.EverythingFlag().ToFlagInt(); + EverythingValue = new PredefinedValues("Everything", everything); + if (!ints.Contains(EverythingValue.Value)) { - return EverythingValue; + ints.Insert(ints.Count, EverythingValue.Value); } } - if (Enum.TryParse(_enumType, (string)currentValue, out var eEnum)) - { - return eEnum.ToString(); - } - - return NotSupported; + _enumValues = ints.Cast().ToList(); } - private protected override void Setup(SerializedProperty property, SelectEnumAttribute currentAttribute) + private protected override string GetButtonName(object currentValue) { - _isFlag = fieldInfo.FieldType.GetCustomAttribute() != null; - var buffer = property.enumNames.ToList(); + var intValue = (int)currentValue; if (_isFlag) { - if (!buffer.Contains(NoneValue)) + if (intValue.Equals(None.Value)) { - buffer.Insert(0, NoneValue); + return None.Name; } - if (!buffer.Contains(EverythingValue)) + if (intValue.Equals(EverythingValue.Value)) { - buffer.Insert(buffer.Count, EverythingValue); + return EverythingValue.Name; } } - _enumValues = buffer.Cast().ToList(); - _enumType = fieldInfo.FieldType; + var value = Enum.ToObject(_enumType, intValue); + return value.ToString(); } private protected override void UpdateValue(SerializedProperty property) { - if (!_isFlag) - { - property.enumValueIndex = _enumValues.IndexOf(_enumValue.ToString()); - } - else - { - var currentEnum = (Enum)Enum.ToObject(_enumType, property.enumValueFlag); - if (_enumValue.IsFlagNone()) - { - currentEnum = _enumValue; - } - else - { - if (currentEnum.HasFlag(_enumValue)) - { - currentEnum = currentEnum.Remove(_enumValue); - } - else - { - currentEnum = currentEnum.Add(_enumValue); - } - } - - property.enumValueFlag = currentEnum.ToFlagInt(); - } + Collection.Update(_enumValue.Property, _enumValue.Data); } + private protected override object GetCurrentValue(SerializedProperty property) { - if (!_isFlag) return _enumValues[property.enumValueIndex].ToString(); - - if (property.enumValueFlag == EnumExtensions.FlagNone) + if (!_isFlag) return _enumValues[property.enumValueIndex]; + int currentEnum; +#if UNITY_2021_1_OR_NEWER + currentEnum = property.enumValueFlag; +#else + currentEnum = property.intValue; +#endif + + if (currentEnum == EnumExtensions.FlagNone) { - return NoneValue; + return None.Value; } - if (property.enumValueFlag == _enumType.AllFlags().ToFlagInt()) + if (currentEnum == EverythingValue.Value) { - return EverythingValue; + return EverythingValue.Value; } - return Enum.ToObject(_enumType, property.enumValueFlag).ToString(); + return ((Enum)Enum.ToObject(_enumType, currentEnum)).ToFlagInt(); } private protected override List GetSelectCollection() @@ -135,8 +142,20 @@ private protected override string[] ResolveGroupedName(object value, DisplayGrou private protected override string ResolveName(object value, DisplayName displayName) { - if (value is string eEnum) + if (value is int intValue) { + var eEnum = Enum.ToObject(_enumType, intValue); + + if (intValue == EverythingValue.Value) + { + return EverythingValue.Name; + } + + if (intValue == None.Value) + { + return None.Name; + } + switch (displayName) { case DisplayName.Short: @@ -153,9 +172,17 @@ private protected override string ResolveName(object value, DisplayName displayN private protected override bool ResolveState(object currentValue, object iteratedValue) { - if (currentValue is string stringCurrent && iteratedValue is string stringIterated) + if (currentValue is int intCurrent && iteratedValue is int intIterated) { - return stringCurrent.Contains(stringIterated); + if (_isFlag) + { + if (intIterated == None.Value || intIterated == EverythingValue.Value) + { + return intCurrent == intIterated; + } + } + + return (intCurrent & intIterated) != 0; } return false; @@ -163,32 +190,26 @@ private protected override bool ResolveState(object currentValue, object iterate private protected override void AfterValueUpdated(SerializedProperty property) { - _enumValue = (Enum)Enum.ToObject(_enumType, 0); + _enumValue = null; } private protected override void OnSelectItem(object obj) { - if (!(obj is string name)) return; - if (_isFlag) + if (obj is SelectedItem value && value.Data is int intValue) { - var intValue = 0; - switch (name) + if (_isFlag) { - case NoneValue: + if (intValue == None.Value) + { intValue = EnumExtensions.FlagNone; - break; - case EverythingValue: - intValue = _enumType.AllFlags().ToFlagInt(); - break; + } + else if (intValue == EverythingValue.Value) + { + intValue = EverythingValue.Value; + } } - _enumValue = (Enum)Enum.ToObject(_enumType, intValue); - SetNeedUpdate(); - } - - if (Enum.TryParse(_enumType, name, out var objectEnum) && objectEnum is Enum eEnum) - { - _enumValue = eEnum; + _enumValue = new SelectedItem(value.Property, (Enum)Enum.ToObject(_enumType, intValue)); SetNeedUpdate(); } } diff --git a/Editor/EditorAddons/Drawers/Select/SelectEnumDrawer.cs.meta b/Editor/EditorAddons/Drawers/Select/SelectEnumDrawer.cs.meta index 96f1687..de6475a 100644 --- a/Editor/EditorAddons/Drawers/Select/SelectEnumDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/Select/SelectEnumDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 7b39e1fd0a714089bab9a8f2ee3ddf4e +guid: 63c188accb4df5942a417b7725abde59 timeCreated: 1664663906 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Select/SelectImplementationDrawer.cs b/Editor/EditorAddons/Drawers/Select/SelectImplementationDrawer.cs index cf19b96..17172ec 100644 --- a/Editor/EditorAddons/Drawers/Select/SelectImplementationDrawer.cs +++ b/Editor/EditorAddons/Drawers/Select/SelectImplementationDrawer.cs @@ -1,4 +1,8 @@ using System; +using System.Collections; +using System.Linq; +using System.Reflection; +using System.Text.RegularExpressions; using BetterAttributes.Runtime.Attributes.Select; using UnityEditor; @@ -9,12 +13,30 @@ public class SelectImplementationDrawer : SelectTypeDrawer { private protected override object GetCurrentValue(SerializedProperty property) { - return property.managedReferenceValue; +#if UNITY_2021_1_OR_NEWER + return property.managedReferenceValue?.GetType(); +#else + if (string.IsNullOrEmpty(property.managedReferenceFullTypename)) + { + return null; + } + + var split = property.managedReferenceFullTypename.Split(' '); + var assembly = GetAssembly(split[0]); + var currentValue = assembly.GetType(split[1]); + return currentValue; +#endif + } + + private static Assembly GetAssembly(string name) + { + return AppDomain.CurrentDomain.GetAssemblies() + .SingleOrDefault(assembly => assembly.GetName().Name == name); } private protected override void UpdateValue(SerializedProperty property) { - property.managedReferenceValue = _type == null ? null : Activator.CreateInstance(_type); + Collection.Update(_type.Property, _type.Data); } } } \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Select/SelectImplementationDrawer.cs.meta b/Editor/EditorAddons/Drawers/Select/SelectImplementationDrawer.cs.meta index 6ae5e1d..ecee0ed 100644 --- a/Editor/EditorAddons/Drawers/Select/SelectImplementationDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/Select/SelectImplementationDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 617ebc4b51d24c01829884c7bdf45c57 +guid: b7acf3278400513479f84db0bea3c02e timeCreated: 1639835782 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Select/SelectTypeDrawer.cs b/Editor/EditorAddons/Drawers/Select/SelectTypeDrawer.cs index 363edf4..a8c8684 100644 --- a/Editor/EditorAddons/Drawers/Select/SelectTypeDrawer.cs +++ b/Editor/EditorAddons/Drawers/Select/SelectTypeDrawer.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; +using BetterAttributes.EditorAddons.Drawers.Base; +using BetterAttributes.EditorAddons.Drawers.Select.Wrappers; +using BetterAttributes.EditorAddons.Drawers.WrapperCollections; using BetterAttributes.Runtime.Attributes.Select; using UnityEditor; using UnityEngine; @@ -8,11 +11,18 @@ namespace BetterAttributes.EditorAddons.Drawers.Select { - public abstract class SelectTypeDrawer : SelectDrawerBase + public abstract class SelectTypeDrawer : SelectDrawerBase { - private protected Type _type; + private protected SelectedItem _type; private List _reflectionTypes; + private protected SelectTypeWrapperCollection Collection => _wrappers as SelectTypeWrapperCollection; + + private protected override WrapperCollection GenerateCollection() + { + return new SelectTypeWrapperCollection(); + } + private void LazyGetAllInheritedType(Type baseType, Type currentObjectType) { if (_reflectionTypes != null) return; @@ -47,13 +57,18 @@ private protected override GUIContent GenerateHeader() private protected override string GetButtonName(object currentValue) { - return currentValue == null ? "null" : currentValue.GetType().Name; + if (currentValue is Type type) + { + return type.Name; + } + + return "null"; } private protected override void Setup(SerializedProperty property, SelectImplementationAttribute currentAttribute) { var currentObjectType = property.serializedObject.targetObject.GetType(); - LazyGetAllInheritedType(currentAttribute.GetFieldType() ?? fieldInfo.FieldType, currentObjectType); + LazyGetAllInheritedType(GetFieldType(), currentObjectType); } private protected override string[] ResolveGroupedName(object value, DisplayGrouping grouping) @@ -121,7 +136,7 @@ private protected override string ResolveName(object value, DisplayName displayN private protected override bool ResolveState(object currentValue, object iteratedValue) { if (iteratedValue == null && currentValue == null) return true; - return iteratedValue is Type type && currentValue?.GetType() == type; + return iteratedValue is Type type && currentValue is Type currentType && currentType == type; } private protected override void AfterValueUpdated(SerializedProperty property) @@ -138,16 +153,16 @@ private protected override void OnSelectItem(object obj) return; } - var type = (Type)obj; - if (_type != null) + var type = (SelectedItem)obj; + if (_type != default) { - if (_type == type) + if (_type.Equals(type)) { return; } } - _type = type; + _type = new SelectedItem(type.Property, type.Data as Type); SetNeedUpdate(); } } diff --git a/Editor/EditorAddons/Drawers/Select/SelectTypeDrawer.cs.meta b/Editor/EditorAddons/Drawers/Select/SelectTypeDrawer.cs.meta index 4155b98..d105bd6 100644 --- a/Editor/EditorAddons/Drawers/Select/SelectTypeDrawer.cs.meta +++ b/Editor/EditorAddons/Drawers/Select/SelectTypeDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: dae4173ed87b440885f8bb5d4691e267 +guid: 10bd5ac1741dfe443a13371d0ed49299 timeCreated: 1665242049 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Select/Wrappers.meta b/Editor/EditorAddons/Drawers/Select/Wrappers.meta new file mode 100644 index 0000000..6d6372e --- /dev/null +++ b/Editor/EditorAddons/Drawers/Select/Wrappers.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c99af7ed59a94a29a0c61181573699f4 +timeCreated: 1665878477 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Select/Wrappers/BaseSelectWrapper.cs b/Editor/EditorAddons/Drawers/Select/Wrappers/BaseSelectWrapper.cs new file mode 100644 index 0000000..e60cce0 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Select/Wrappers/BaseSelectWrapper.cs @@ -0,0 +1,20 @@ +using BetterAttributes.EditorAddons.Drawers.Utilities; +using UnityEditor; + +namespace BetterAttributes.EditorAddons.Drawers.Select.Wrappers +{ + public class BaseSelectWrapper : UtilityWrapper + { + private protected SerializedProperty _property; + + public override void Deconstruct() + { + _property = null; + } + + public void SetProperty(SerializedProperty property) + { + _property = property; + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Select/Wrappers/BaseSelectWrapper.cs.meta b/Editor/EditorAddons/Drawers/Select/Wrappers/BaseSelectWrapper.cs.meta new file mode 100644 index 0000000..5ca8e15 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Select/Wrappers/BaseSelectWrapper.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1c5b1656df4041019aec7e753d67dc52 +timeCreated: 1665878498 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Select/Wrappers/SelectEnumWrapper.cs b/Editor/EditorAddons/Drawers/Select/Wrappers/SelectEnumWrapper.cs new file mode 100644 index 0000000..288b641 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Select/Wrappers/SelectEnumWrapper.cs @@ -0,0 +1,47 @@ +using System; + +namespace BetterAttributes.EditorAddons.Drawers.Select.Wrappers +{ + public class SelectEnumWrapper : BaseSelectWrapper + { + private bool _isFlag; + + public void Update(Enum value) + { + if (_property == null) return; + var enumType = value.GetType(); + if (!_isFlag) + { + _property.intValue = value.ToFlagInt(); + } + else + { + Enum currentEnum; +#if UNITY_2021_1_OR_NEWER + currentEnum = (Enum)Enum.ToObject(enumType, _property.enumValueFlag); +#else + currentEnum = (Enum)Enum.ToObject(enumType, _property.intValue); +#endif + + if (value.IsFlagNone()) + { + currentEnum = value; + } + else + { + currentEnum = currentEnum.HasFlag(value) ? currentEnum.Remove(value) : currentEnum.Add(value); + } +#if UNITY_2021_1_OR_NEWER + _property.enumValueFlag = currentEnum.ToFlagInt(); +#else + _property.intValue = currentEnum.ToFlagInt(); +#endif + } + } + + public void SetIsFlag(bool isFlag) + { + _isFlag = isFlag; + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Select/Wrappers/SelectEnumWrapper.cs.meta b/Editor/EditorAddons/Drawers/Select/Wrappers/SelectEnumWrapper.cs.meta new file mode 100644 index 0000000..62fb48d --- /dev/null +++ b/Editor/EditorAddons/Drawers/Select/Wrappers/SelectEnumWrapper.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 708f83a12d174a0197c8ddebc35ffed4 +timeCreated: 1665884368 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Select/Wrappers/SelectTypeWrapper.cs b/Editor/EditorAddons/Drawers/Select/Wrappers/SelectTypeWrapper.cs new file mode 100644 index 0000000..507a42a --- /dev/null +++ b/Editor/EditorAddons/Drawers/Select/Wrappers/SelectTypeWrapper.cs @@ -0,0 +1,13 @@ +using System; + +namespace BetterAttributes.EditorAddons.Drawers.Select.Wrappers +{ + public class SelectTypeWrapper : BaseSelectWrapper + { + public void Update(Type value) + { + if (_property == null) return; + _property.managedReferenceValue = value == null ? null : Activator.CreateInstance(value); + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Select/Wrappers/SelectTypeWrapper.cs.meta b/Editor/EditorAddons/Drawers/Select/Wrappers/SelectTypeWrapper.cs.meta new file mode 100644 index 0000000..d6e9b60 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Select/Wrappers/SelectTypeWrapper.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 051848b3663f46acaf871a66fb9b5a98 +timeCreated: 1665884368 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Utilities.meta b/Editor/EditorAddons/Drawers/Utilities.meta index eb1d05b..38d715b 100644 --- a/Editor/EditorAddons/Drawers/Utilities.meta +++ b/Editor/EditorAddons/Drawers/Utilities.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: f1516e6176784dd2880e3b193ba42941 +guid: e662470b67c43cf4cba3a441ad5d81cd timeCreated: 1663379141 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs b/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs index ca4c5ba..434781d 100644 --- a/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs +++ b/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs @@ -7,7 +7,9 @@ namespace BetterAttributes.EditorAddons.Drawers.Utilities public abstract class UtilityWrapper { public abstract void Deconstruct(); - } + } + + public abstract class BaseUtility where THandler : new() { @@ -52,11 +54,11 @@ private protected Dictionary GetWrapperDictionary(Type type) public void ValidateCachedProperties(WrapperCollection gizmoWrappers) where T : UtilityWrapper { - foreach (var (key, value) in gizmoWrappers) + foreach (var value in gizmoWrappers) { - if (!IsSupported(value.Item2)) + if (!IsSupported(value.Value.Type)) { - gizmoWrappers.Remove(key); + gizmoWrappers.Remove(value.Key); } } } @@ -75,8 +77,6 @@ public virtual T GetUtilityWrapper(Type type, Type attributeType) where T : U var gizmoWrappers = GetWrapperDictionary(attributeType); var wrapperType = gizmoWrappers[type]; - if (wrapperType.IsAssignableFrom(typeof(T))) return null; - return (T)Activator.CreateInstance(wrapperType); } diff --git a/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs.meta b/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs.meta index 4814609..63b5fc9 100644 --- a/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs.meta +++ b/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 59c7dcc143484c8cb1c638391f6ebd0c +guid: 330ff3f0836a920478ae356abe6138f9 timeCreated: 1663078936 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Utilities/GizmoUtility.cs.meta b/Editor/EditorAddons/Drawers/Utilities/GizmoUtility.cs.meta index 62e03e8..2d5fe09 100644 --- a/Editor/EditorAddons/Drawers/Utilities/GizmoUtility.cs.meta +++ b/Editor/EditorAddons/Drawers/Utilities/GizmoUtility.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: d5fca9d9a7734effa77ba2c5f347ecb8 +guid: aac722e5ac7df2f4e94791c4207a4a04 timeCreated: 1658863143 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Utilities/PreviewUtility.cs b/Editor/EditorAddons/Drawers/Utilities/PreviewUtility.cs index 73628bf..a31a1d7 100644 --- a/Editor/EditorAddons/Drawers/Utilities/PreviewUtility.cs +++ b/Editor/EditorAddons/Drawers/Utilities/PreviewUtility.cs @@ -9,28 +9,12 @@ namespace BetterAttributes.EditorAddons.Drawers.Utilities { public class PreviewUtility : BaseUtility { - private class AssignableFromComparer : IEqualityComparer - { - public bool Equals(Type x, Type y) - { - if (ReferenceEquals(x, y)) return true; - if (ReferenceEquals(x, null)) return false; - if (ReferenceEquals(y, null)) return false; - return x.IsAssignableFrom(y) || x == y; - } - - public int GetHashCode(Type obj) - { - return 0; - } - } - private protected override WrappersTypeCollection GenerateCollection() { return new WrappersTypeCollection() { { - typeof(PreviewAttribute), new Dictionary(new AssignableFromComparer()) + typeof(PreviewAttribute), new Dictionary(AssignableFromComparer.Instance) { { typeof(Sprite), typeof(SpriteWrapper) }, { typeof(Texture2D), typeof(TextureWrapper) }, @@ -42,7 +26,7 @@ private protected override WrappersTypeCollection GenerateCollection() private protected override HashSet GenerateAvailable() { - return new HashSet(new AssignableFromComparer()) + return new HashSet(AssignableFromComparer.Instance) { typeof(Sprite), typeof(Texture), diff --git a/Editor/EditorAddons/Drawers/Utilities/PreviewUtility.cs.meta b/Editor/EditorAddons/Drawers/Utilities/PreviewUtility.cs.meta index 17275c4..a2afcb8 100644 --- a/Editor/EditorAddons/Drawers/Utilities/PreviewUtility.cs.meta +++ b/Editor/EditorAddons/Drawers/Utilities/PreviewUtility.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: ffb71ca9b7d8497883462008bcd8a8fd +guid: aad5d57aec45ea34b8592c9c4221d84f timeCreated: 1663071014 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Utilities/SelectUtility.cs b/Editor/EditorAddons/Drawers/Utilities/SelectUtility.cs new file mode 100644 index 0000000..bc6e206 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Utilities/SelectUtility.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using BetterAttributes.EditorAddons.Drawers.Base; +using BetterAttributes.EditorAddons.Drawers.Select.Wrappers; +using BetterAttributes.Runtime.Attributes.Select; + +namespace BetterAttributes.EditorAddons.Drawers.Utilities +{ + public class SelectUtility : BaseUtility + { + + + private protected override WrappersTypeCollection GenerateCollection() + { + return new WrappersTypeCollection(TypeComparer.Instance) + { + { + typeof(SelectImplementationAttribute), new Dictionary(TypeComparer.Instance) + { + { typeof(Type), typeof(SelectTypeWrapper) } + } + }, + { + typeof(SelectEnumAttribute), new Dictionary(TypeComparer.Instance) + { + { typeof(Enum), typeof(SelectEnumWrapper) } + } + } + }; + } + + private protected override HashSet GenerateAvailable() + { + return new HashSet(TypeComparer.Instance) + { + typeof(Enum), + typeof(Type) + }; + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Utilities/SelectUtility.cs.meta b/Editor/EditorAddons/Drawers/Utilities/SelectUtility.cs.meta new file mode 100644 index 0000000..fd08c57 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Utilities/SelectUtility.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bb61332dd49642dd9ce7388fefb4d68c +timeCreated: 1665878415 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/WrapperCollections.meta b/Editor/EditorAddons/Drawers/WrapperCollections.meta index 9e533b9..d94dd70 100644 --- a/Editor/EditorAddons/Drawers/WrapperCollections.meta +++ b/Editor/EditorAddons/Drawers/WrapperCollections.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: d136bcbb4de54c1cb4372ae6429df73e +guid: a4c1df3273d171a4c9376b7157540a6a timeCreated: 1663378981 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/WrapperCollections/GizmoWrappers.cs b/Editor/EditorAddons/Drawers/WrapperCollections/GizmoWrappers.cs index 9d1b2e6..34f5740 100644 --- a/Editor/EditorAddons/Drawers/WrapperCollections/GizmoWrappers.cs +++ b/Editor/EditorAddons/Drawers/WrapperCollections/GizmoWrappers.cs @@ -11,7 +11,7 @@ public void Apply(SceneView sceneView) { foreach (var gizmo in Values) { - gizmo.Item1.Apply(sceneView); + gizmo.Wrapper.Apply(sceneView); } } @@ -19,7 +19,7 @@ public void SetProperty(SerializedProperty property, Type fieldType) { if (TryGetValue(property, out var gizmoWrapper)) { - gizmoWrapper.Item1.SetProperty(property, fieldType); + gizmoWrapper.Wrapper.SetProperty(property, fieldType); } } @@ -27,7 +27,7 @@ public bool ShowInSceneView(SerializedProperty property) { if (TryGetValue(property, out var gizmoWrapper)) { - return gizmoWrapper.Item1.ShowInSceneView; + return gizmoWrapper.Wrapper.ShowInSceneView; } return false; @@ -37,7 +37,7 @@ public void SwitchShowMode(SerializedProperty property) { if (TryGetValue(property, out var gizmoWrapper)) { - gizmoWrapper.Item1.SwitchShowMode(); + gizmoWrapper.Wrapper.SwitchShowMode(); } } } diff --git a/Editor/EditorAddons/Drawers/WrapperCollections/GizmoWrappers.cs.meta b/Editor/EditorAddons/Drawers/WrapperCollections/GizmoWrappers.cs.meta index 9d96755..52d0b07 100644 --- a/Editor/EditorAddons/Drawers/WrapperCollections/GizmoWrappers.cs.meta +++ b/Editor/EditorAddons/Drawers/WrapperCollections/GizmoWrappers.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: e6761a72f29744c9b510af283f92200b +guid: 6ec32285fee18354788f71900f000eaa timeCreated: 1660693259 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/WrapperCollections/PreviewWrappers.cs b/Editor/EditorAddons/Drawers/WrapperCollections/PreviewWrappers.cs index fd3acbf..5d541ba 100644 --- a/Editor/EditorAddons/Drawers/WrapperCollections/PreviewWrappers.cs +++ b/Editor/EditorAddons/Drawers/WrapperCollections/PreviewWrappers.cs @@ -11,8 +11,8 @@ public void OnGUI(Rect position, SerializedProperty property, float previewSize, { foreach (var value in Values) { - value.Item1.IsObjectUpdated(objectChanged); - value.Item1.OnGUI(position, property, previewSize); + value.Wrapper.IsObjectUpdated(objectChanged); + value.Wrapper.OnGUI(position, property, previewSize); } } } diff --git a/Editor/EditorAddons/Drawers/WrapperCollections/PreviewWrappers.cs.meta b/Editor/EditorAddons/Drawers/WrapperCollections/PreviewWrappers.cs.meta index 72635fe..f42a190 100644 --- a/Editor/EditorAddons/Drawers/WrapperCollections/PreviewWrappers.cs.meta +++ b/Editor/EditorAddons/Drawers/WrapperCollections/PreviewWrappers.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: b7554c75403247f5909f42a9e8d64668 +guid: edc5e83ec09ab0d4abf8aedea8b01257 timeCreated: 1663277963 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/WrapperCollections/SelectWrapperCollection.cs b/Editor/EditorAddons/Drawers/WrapperCollections/SelectWrapperCollection.cs new file mode 100644 index 0000000..8dd464b --- /dev/null +++ b/Editor/EditorAddons/Drawers/WrapperCollections/SelectWrapperCollection.cs @@ -0,0 +1,29 @@ +using System; +using BetterAttributes.EditorAddons.Drawers.Base; +using BetterAttributes.EditorAddons.Drawers.Select.Wrappers; +using UnityEditor; + +namespace BetterAttributes.EditorAddons.Drawers.WrapperCollections +{ + public class SelectTypeWrapperCollection : WrapperCollection + { + public void Update(SerializedProperty property, Type type) + { + if (TryGetValue(property, out var value)) + { + value.Wrapper.Update(type); + } + } + } + + public class SelectEnumWrapperCollection : WrapperCollection + { + public void Update(SerializedProperty property, Enum type) + { + if (TryGetValue(property, out var value)) + { + value.Wrapper.Update(type); + } + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/WrapperCollections/SelectWrapperCollection.cs.meta b/Editor/EditorAddons/Drawers/WrapperCollections/SelectWrapperCollection.cs.meta new file mode 100644 index 0000000..0c44f85 --- /dev/null +++ b/Editor/EditorAddons/Drawers/WrapperCollections/SelectWrapperCollection.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c670276c7ea24a488ad436aa143dc249 +timeCreated: 1665883237 \ No newline at end of file diff --git a/Editor/EditorAddons/Helpers.meta b/Editor/EditorAddons/Helpers.meta index ab06363..56a7998 100644 --- a/Editor/EditorAddons/Helpers.meta +++ b/Editor/EditorAddons/Helpers.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: f77abf5614a7431abf6a57d71b261b71 +guid: 81f5be64f3f400d44bf869dea1ca0a43 timeCreated: 1663026857 \ No newline at end of file diff --git a/Editor/EditorAddons/Helpers/ComponentExtension.cs.meta b/Editor/EditorAddons/Helpers/ComponentExtension.cs.meta index 91bf65d..a6cf52e 100644 --- a/Editor/EditorAddons/Helpers/ComponentExtension.cs.meta +++ b/Editor/EditorAddons/Helpers/ComponentExtension.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 6e3bc0e3871e4dbf8341a5935347c422 +guid: 7dd301e8804167240b784eb2bd132115 timeCreated: 1663537334 \ No newline at end of file diff --git a/Editor/EditorAddons/Helpers/DrawersHelper.cs.meta b/Editor/EditorAddons/Helpers/DrawersHelper.cs.meta index 17e6ecb..b98ef52 100644 --- a/Editor/EditorAddons/Helpers/DrawersHelper.cs.meta +++ b/Editor/EditorAddons/Helpers/DrawersHelper.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 38dafd06067341eaaec7f025502144a3 +guid: 53a1d0aea6406354a9cfbe1ac4fbe110 timeCreated: 1663027838 \ No newline at end of file diff --git a/Editor/EditorAddons/Helpers/DropDown.meta b/Editor/EditorAddons/Helpers/DropDown.meta index 6cb14c3..d58b96c 100644 --- a/Editor/EditorAddons/Helpers/DropDown.meta +++ b/Editor/EditorAddons/Helpers/DropDown.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 3bf7081852654920a6e4cb33bc8de939 +guid: 9e1dd0417f3307f4aac6c138fcce744d timeCreated: 1664145884 \ No newline at end of file diff --git a/Editor/EditorAddons/Helpers/DropDown/DropdownBase.cs b/Editor/EditorAddons/Helpers/DropDown/DropdownBase.cs index 5ef4058..c3244a6 100644 --- a/Editor/EditorAddons/Helpers/DropDown/DropdownBase.cs +++ b/Editor/EditorAddons/Helpers/DropDown/DropdownBase.cs @@ -18,7 +18,15 @@ public bool Equals(string value) return Content.text.Equals(value); } - public abstract bool Contains(string searchText, - StringComparison comparison = StringComparison.OrdinalIgnoreCase); + + public bool Contains(string searchText, + StringComparison comparison = StringComparison.OrdinalIgnoreCase) + { +#if UNITY_2021_1_OR_NEWER + return Content.text.Contains(searchText, comparison); +#else + return Content.text.IndexOf(searchText, 0, StringComparison.OrdinalIgnoreCase) != -1; +#endif + } } } \ No newline at end of file diff --git a/Editor/EditorAddons/Helpers/DropDown/DropdownBase.cs.meta b/Editor/EditorAddons/Helpers/DropDown/DropdownBase.cs.meta index cd43e7c..868129c 100644 --- a/Editor/EditorAddons/Helpers/DropDown/DropdownBase.cs.meta +++ b/Editor/EditorAddons/Helpers/DropDown/DropdownBase.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 8ea3cb1e5ed841aa94d8c1e0b6706d70 +guid: ddb2c49a75bd78340bcd8cab7538287e timeCreated: 1664654525 \ No newline at end of file diff --git a/Editor/EditorAddons/Helpers/DropDown/DropdownCollection.cs.meta b/Editor/EditorAddons/Helpers/DropDown/DropdownCollection.cs.meta index 3340191..69c48b9 100644 --- a/Editor/EditorAddons/Helpers/DropDown/DropdownCollection.cs.meta +++ b/Editor/EditorAddons/Helpers/DropDown/DropdownCollection.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b139393ed3204988ae3c906d41cd0372 +guid: f4e05ad49b8b09c48a3e2c1caaaf8de9 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Editor/EditorAddons/Helpers/DropDown/DropdownGUI.cs.meta b/Editor/EditorAddons/Helpers/DropDown/DropdownGUI.cs.meta index 6e2f577..08bb418 100644 --- a/Editor/EditorAddons/Helpers/DropDown/DropdownGUI.cs.meta +++ b/Editor/EditorAddons/Helpers/DropDown/DropdownGUI.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 90e0d00a32b942e3bbee9497c92fe8d8 +guid: 39dbfa04225421a4680dd2b847db9a53 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Editor/EditorAddons/Helpers/DropDown/DropdownItem.cs b/Editor/EditorAddons/Helpers/DropDown/DropdownItem.cs index 512ef6a..016924c 100644 --- a/Editor/EditorAddons/Helpers/DropDown/DropdownItem.cs +++ b/Editor/EditorAddons/Helpers/DropDown/DropdownItem.cs @@ -7,26 +7,22 @@ public class DropdownItem : DropdownBase { private readonly Action _onSelect; private readonly object _object; - + public DropdownItem(GUIContent content, bool state, Action onSelect, object data) : base(content) { if (state) { Content.image = DrawersHelper.GetIcon(IconType.Checkmark); } + _onSelect = onSelect; _object = data; } - + internal override bool Invoke(DropdownWindow downPopup) { _onSelect?.Invoke(_object); return true; } - - public override bool Contains(string searchText, StringComparison comparison = StringComparison.OrdinalIgnoreCase) - { - return Content.text.Contains(searchText, comparison); - } } } \ No newline at end of file diff --git a/Editor/EditorAddons/Helpers/DropDown/DropdownItem.cs.meta b/Editor/EditorAddons/Helpers/DropDown/DropdownItem.cs.meta index ced8bd6..1e79db6 100644 --- a/Editor/EditorAddons/Helpers/DropDown/DropdownItem.cs.meta +++ b/Editor/EditorAddons/Helpers/DropDown/DropdownItem.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 454f2463c0014548b6a6a0c055adf711 +guid: 1b2ce7d41e5e358428a0f15db773d9ef MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Editor/EditorAddons/Helpers/DropDown/DropdownSubTree.cs b/Editor/EditorAddons/Helpers/DropDown/DropdownSubTree.cs index ca5ac11..42d664c 100644 --- a/Editor/EditorAddons/Helpers/DropDown/DropdownSubTree.cs +++ b/Editor/EditorAddons/Helpers/DropDown/DropdownSubTree.cs @@ -23,10 +23,5 @@ internal override bool Invoke(DropdownWindow downPopup) downPopup.SetCurrentDrawItems(_node); return false; } - - public override bool Contains(string searchText, StringComparison comparison = StringComparison.OrdinalIgnoreCase) - { - return Content.text.Contains(searchText, comparison); - } } } \ No newline at end of file diff --git a/Editor/EditorAddons/Helpers/DropDown/DropdownSubTree.cs.meta b/Editor/EditorAddons/Helpers/DropDown/DropdownSubTree.cs.meta index 9387b4c..a3e5465 100644 --- a/Editor/EditorAddons/Helpers/DropDown/DropdownSubTree.cs.meta +++ b/Editor/EditorAddons/Helpers/DropDown/DropdownSubTree.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2d6d940a579d448993de3477036030ad +guid: f8d76b36414c19040a4cfe52b18c8951 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Editor/EditorAddons/Helpers/DropDown/DropdownWindow.cs.meta b/Editor/EditorAddons/Helpers/DropDown/DropdownWindow.cs.meta index 3e947be..065e451 100644 --- a/Editor/EditorAddons/Helpers/DropDown/DropdownWindow.cs.meta +++ b/Editor/EditorAddons/Helpers/DropDown/DropdownWindow.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 4202a78433ad46dcbe55f03e4dd4d1ee +guid: 6079b743a3e4047419d3d60b8c8a8a61 timeCreated: 1663665219 \ No newline at end of file diff --git a/Editor/EditorAddons/Helpers/EditorPopup.cs.meta b/Editor/EditorAddons/Helpers/EditorPopup.cs.meta index f688df9..6d88aa2 100644 --- a/Editor/EditorAddons/Helpers/EditorPopup.cs.meta +++ b/Editor/EditorAddons/Helpers/EditorPopup.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 81663e7bcb6a416384d556ae9e0bc9a4 +guid: 5e6178ab64d49854ca32db2c697ebac6 timeCreated: 1663028856 \ No newline at end of file diff --git a/Editor/EditorAddons/Helpers/Styles.cs.meta b/Editor/EditorAddons/Helpers/Styles.cs.meta index 65549fa..b6eeb2e 100644 --- a/Editor/EditorAddons/Helpers/Styles.cs.meta +++ b/Editor/EditorAddons/Helpers/Styles.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: f678a8badc6b46458e913dbd17639809 +guid: 4eadd59fe165d5745aa5cac9b5bd67da timeCreated: 1663790547 \ No newline at end of file diff --git a/LICENSE.meta b/LICENSE.meta index 5be959f..332d9c5 100644 --- a/LICENSE.meta +++ b/LICENSE.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9e31385227fd64d4284e1e243a323754 +guid: e54205027404307478041d5a3b123ed1 DefaultImporter: externalObjects: {} userData: diff --git a/README.md.meta b/README.md.meta index 840eb36..ef30bd0 100644 --- a/README.md.meta +++ b/README.md.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d4a5da1a8a5d8874e9098f730c7f9ffc +guid: 54777cb1d0317b94393803790d5f12b6 TextScriptImporter: externalObjects: {} userData: diff --git a/Runtime.meta b/Runtime.meta index 3dc817a..15948a4 100644 --- a/Runtime.meta +++ b/Runtime.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2fdc2c4c917930641802d9f2a1e38837 +guid: bbfbbab4f201a9b4f94e68e8cf8c25e7 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/Attributes.meta b/Runtime/Attributes.meta index 3e24237..db42823 100644 --- a/Runtime/Attributes.meta +++ b/Runtime/Attributes.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: fac4803e13b04463b0037b00e4dc43eb +guid: e0fff6456c73e5547b5dd6d8d6f376a8 timeCreated: 1663379476 \ No newline at end of file diff --git a/Runtime/Attributes/Gizmo.meta b/Runtime/Attributes/Gizmo.meta index 5d18849..c99aa27 100644 --- a/Runtime/Attributes/Gizmo.meta +++ b/Runtime/Attributes/Gizmo.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 693ba1e7498b463c92970d10c4ab6007 +guid: 9dd405ad421b651478b43ef0b2a6c26c timeCreated: 1658860440 \ No newline at end of file diff --git a/Runtime/Attributes/Gizmo/GizmoAttribute.cs.meta b/Runtime/Attributes/Gizmo/GizmoAttribute.cs.meta index dba3fe8..febd31b 100644 --- a/Runtime/Attributes/Gizmo/GizmoAttribute.cs.meta +++ b/Runtime/Attributes/Gizmo/GizmoAttribute.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: edcdcd1f0dc748169487363f12a4e91d +guid: 241346ca3dc9ffe48bbb736fbdb585ad timeCreated: 1658860643 \ No newline at end of file diff --git a/Runtime/Attributes/Gizmo/GizmoLocalAttribute.cs.meta b/Runtime/Attributes/Gizmo/GizmoLocalAttribute.cs.meta index e2d1648..ef69a0f 100644 --- a/Runtime/Attributes/Gizmo/GizmoLocalAttribute.cs.meta +++ b/Runtime/Attributes/Gizmo/GizmoLocalAttribute.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 53954a8661ae46f6be1d4bd79bd87061 +guid: 627a231c8de1ed44fb8e78db23433ce3 timeCreated: 1660514008 \ No newline at end of file diff --git a/Runtime/Attributes/Headers.meta b/Runtime/Attributes/Headers.meta index f00ff2e..8c6aae6 100644 --- a/Runtime/Attributes/Headers.meta +++ b/Runtime/Attributes/Headers.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 374e3b5296923674f93185a49c839c5e +guid: 02660e4d0461d71419c7d9d85ba3ae9c folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/Attributes/Headers/PrefabHeaderAttribute.cs.meta b/Runtime/Attributes/Headers/PrefabHeaderAttribute.cs.meta index 64b5535..57cf09b 100644 --- a/Runtime/Attributes/Headers/PrefabHeaderAttribute.cs.meta +++ b/Runtime/Attributes/Headers/PrefabHeaderAttribute.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: e4b7b0fad5e747c9a6f489ce84217c38 +guid: d411062932bc0134a9d6588dde4436e6 timeCreated: 1615412228 \ No newline at end of file diff --git a/Runtime/Attributes/Headers/ReferencesHeaderAttribute.cs.meta b/Runtime/Attributes/Headers/ReferencesHeaderAttribute.cs.meta index a47fe6c..6d651c2 100644 --- a/Runtime/Attributes/Headers/ReferencesHeaderAttribute.cs.meta +++ b/Runtime/Attributes/Headers/ReferencesHeaderAttribute.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: bbfd5fb04305481b99ddaebe656c27c2 +guid: 4eaf9f0622a42f543afd291071410785 timeCreated: 1615206836 \ No newline at end of file diff --git a/Runtime/Attributes/Headers/SettingsHeaderAttribute.cs.meta b/Runtime/Attributes/Headers/SettingsHeaderAttribute.cs.meta index cac8374..73e50f9 100644 --- a/Runtime/Attributes/Headers/SettingsHeaderAttribute.cs.meta +++ b/Runtime/Attributes/Headers/SettingsHeaderAttribute.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 32e2e9bec3ff417aa32e795d5adc2172 +guid: eb7a1874dd13f9e489834dcfcba798a5 timeCreated: 1615206836 \ No newline at end of file diff --git a/Runtime/Attributes/Headers/StateHeaderAttribute.cs.meta b/Runtime/Attributes/Headers/StateHeaderAttribute.cs.meta index 13a3b48..33bd837 100644 --- a/Runtime/Attributes/Headers/StateHeaderAttribute.cs.meta +++ b/Runtime/Attributes/Headers/StateHeaderAttribute.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 09e6362da55c4bdfb777768fffa9db36 +guid: 84b336364b78733439c71f4de23b3308 timeCreated: 1615206836 \ No newline at end of file diff --git a/Runtime/Attributes/Preview.meta b/Runtime/Attributes/Preview.meta index 81ab954..f6c8c50 100644 --- a/Runtime/Attributes/Preview.meta +++ b/Runtime/Attributes/Preview.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 5d81abe5b28e49c090cd276d41238f34 +guid: 87db2cc82f1cc1842877382679acf6fd timeCreated: 1663026203 \ No newline at end of file diff --git a/Runtime/Attributes/Preview/PreviewAttribute.cs.meta b/Runtime/Attributes/Preview/PreviewAttribute.cs.meta index 041f3b8..eec9af9 100644 --- a/Runtime/Attributes/Preview/PreviewAttribute.cs.meta +++ b/Runtime/Attributes/Preview/PreviewAttribute.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: e2e3f4b72bd040248ab96b250fb07ea5 +guid: 9f6173650a1bbe147aee19fd8841ff01 timeCreated: 1663026450 \ No newline at end of file diff --git a/Runtime/Attributes/ReadOnly.meta b/Runtime/Attributes/ReadOnly.meta index eb188dd..94b6c10 100644 --- a/Runtime/Attributes/ReadOnly.meta +++ b/Runtime/Attributes/ReadOnly.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 81d66348b40f44bbb6c45b7c4e452116 +guid: 82c4993e553c4894ca2bce0c3c41e26e timeCreated: 1658861808 \ No newline at end of file diff --git a/Runtime/Attributes/ReadOnly/ReadOnlyFieldAttribute.cs.meta b/Runtime/Attributes/ReadOnly/ReadOnlyFieldAttribute.cs.meta index b8df899..aef005b 100644 --- a/Runtime/Attributes/ReadOnly/ReadOnlyFieldAttribute.cs.meta +++ b/Runtime/Attributes/ReadOnly/ReadOnlyFieldAttribute.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: e7078e95a3ab4e12bc21fe9988a22d09 +guid: a0032eb05a6b46c4584d8883b40b63ee timeCreated: 1657919451 \ No newline at end of file diff --git a/Runtime/Attributes/Rename.meta b/Runtime/Attributes/Rename.meta index e82608b..38b7e72 100644 --- a/Runtime/Attributes/Rename.meta +++ b/Runtime/Attributes/Rename.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 7315f5c38aca4cf089363693b65d1332 +guid: a4037724f2119d54cacde04fee7aa697 timeCreated: 1663538027 \ No newline at end of file diff --git a/Runtime/Attributes/Rename/RenameFieldAttribute.cs.meta b/Runtime/Attributes/Rename/RenameFieldAttribute.cs.meta index 5bb758b..657f072 100644 --- a/Runtime/Attributes/Rename/RenameFieldAttribute.cs.meta +++ b/Runtime/Attributes/Rename/RenameFieldAttribute.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 0c7d5a2e51794a2880789d0d1e8285d6 +guid: 4ed71eefcab17814e9a2d1389389b946 timeCreated: 1663538038 \ No newline at end of file diff --git a/Runtime/Attributes/Select.meta b/Runtime/Attributes/Select.meta index 862e39e..f87d79a 100644 --- a/Runtime/Attributes/Select.meta +++ b/Runtime/Attributes/Select.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 298ca44afb13d0d4299e2a40df37a8a5 +guid: 73d490291a8f65e4fab8f8f77f2e56c5 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/Attributes/Select/SelectAttributeBase.cs.meta b/Runtime/Attributes/Select/SelectAttributeBase.cs.meta index 4a11f40..9febf13 100644 --- a/Runtime/Attributes/Select/SelectAttributeBase.cs.meta +++ b/Runtime/Attributes/Select/SelectAttributeBase.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 24547acb90744ba4975b28167030d2e1 +guid: bbec524d8af1e1446acb0659cbdf4f27 timeCreated: 1640213832 \ No newline at end of file diff --git a/Runtime/Attributes/Select/SelectEnumAttribute.cs.meta b/Runtime/Attributes/Select/SelectEnumAttribute.cs.meta index 628b2dc..37365a0 100644 --- a/Runtime/Attributes/Select/SelectEnumAttribute.cs.meta +++ b/Runtime/Attributes/Select/SelectEnumAttribute.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 47255c6ef15e40f79fac3099b2beca4f +guid: 0397b7dfa4efbd2439ea06250be3b2fd timeCreated: 1664663288 \ No newline at end of file diff --git a/Runtime/Attributes/Select/SelectImplementationAttribute.cs.meta b/Runtime/Attributes/Select/SelectImplementationAttribute.cs.meta index e1d9beb..6f3d68b 100644 --- a/Runtime/Attributes/Select/SelectImplementationAttribute.cs.meta +++ b/Runtime/Attributes/Select/SelectImplementationAttribute.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 9de096c6e4e8462bb026f1114a2d4145 +guid: 49bab54f0509d7040ab30285e6502e86 timeCreated: 1639835761 \ No newline at end of file diff --git a/Runtime/BetterAttributes.Runtime.asmdef.meta b/Runtime/BetterAttributes.Runtime.asmdef.meta index 7cd7b39..0cc1c73 100644 --- a/Runtime/BetterAttributes.Runtime.asmdef.meta +++ b/Runtime/BetterAttributes.Runtime.asmdef.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 618e123b521db74429ef44b837b020b0 +guid: 35101f455c979e94c9a0a4793484b7fd AssemblyDefinitionImporter: externalObjects: {} userData: diff --git a/Runtime/EditorButtonAttribute.cs.meta b/Runtime/EditorButtonAttribute.cs.meta index e5c15a1..f3738f3 100644 --- a/Runtime/EditorButtonAttribute.cs.meta +++ b/Runtime/EditorButtonAttribute.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6a7b39b2c9972a44eb0ba1b93c5c95cd +guid: 00883627cf6f6bd48ae0a6ca8d67d707 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Runtime/ReflectionExtensions.cs.meta b/Runtime/ReflectionExtensions.cs.meta index f1d69f0..e254b11 100644 --- a/Runtime/ReflectionExtensions.cs.meta +++ b/Runtime/ReflectionExtensions.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 5ab4be6f316a48b99df45c548174aed9 +guid: 2554d27fdc2e6274290ae2fdfd387bf0 timeCreated: 1656879372 \ No newline at end of file diff --git a/Runtime/StringExtensions.cs.meta b/Runtime/StringExtensions.cs.meta index f5a921c..34d4eee 100644 --- a/Runtime/StringExtensions.cs.meta +++ b/Runtime/StringExtensions.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 4fb64c77459f4cffb853c71d7abb709a +guid: ba23590352e8ba14ca7d06ffec3388dd timeCreated: 1656876252 \ No newline at end of file diff --git a/Runtime/Tree.meta b/Runtime/Tree.meta index a0e3ea3..942c382 100644 --- a/Runtime/Tree.meta +++ b/Runtime/Tree.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 2965bd8f5d1144e0b54a0dc26c64df98 +guid: 19cbcdf209e0a1c4caf36595c215a81d timeCreated: 1664531402 \ No newline at end of file diff --git a/Runtime/Tree/TreeNode.cs.meta b/Runtime/Tree/TreeNode.cs.meta index f289b01..d789ed4 100644 --- a/Runtime/Tree/TreeNode.cs.meta +++ b/Runtime/Tree/TreeNode.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 756bd0d50773478e99308616b33ae4d5 +guid: ad2775f8d74f5b64fbffcf3080f57db9 timeCreated: 1664328446 \ No newline at end of file diff --git a/package.json b/package.json index 36c385c..3adff3f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.uurha.betterattributes", "displayName": "Unity Better Attributes", - "version": "0.0.7", + "version": "0.0.8", "unity": "2018.3", "description": "Unity attributes, allows to serialize interfaces, draw handles for Vector3/Vector2/Quaternion/Bounds, create read only fields.", "author": { diff --git a/package.json.meta b/package.json.meta index 5485c23..d253082 100644 --- a/package.json.meta +++ b/package.json.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 37df7876a60543669df7c4301fbd2ad1 +guid: 900c8f807b445074eb81e950cd267b75 timeCreated: 1660514100 \ No newline at end of file