From 44a4547019b6412395cf35db72cebe623dc841a1 Mon Sep 17 00:00:00 2001 From: uurha Date: Sun, 1 Dec 2024 01:29:52 +0000 Subject: [PATCH] Merge pull request #13 from techno-dwarf-works/feature/refactoring Version 0.0.4 --- .../DrawInspector/DrawInspectorDrawer.cs | 2 +- .../DrawInspector/DrawInspectorHandler.cs | 4 ++ Editor/Drawers/Gizmo/GizmoDrawer.cs | 2 +- .../Gizmo/LocalHandlers/BoundsLocalHandler.cs | 5 +- .../LocalHandlers/QuaternionLocalHandler.cs | 3 + .../LocalHandlers/Vector2LocalHandler.cs | 3 + .../LocalHandlers/Vector3LocalHandler.cs | 3 + .../Gizmo/WorldHandlers/BoundsHandler.cs | 6 +- .../Gizmo/WorldHandlers/QuaternionHandler.cs | 3 + .../Gizmo/WorldHandlers/Vector2Handler.cs | 3 + .../Gizmo/WorldHandlers/Vector3Handler.cs | 3 + Editor/Drawers/HandlerMaps.meta | 3 - .../DrawInspectorTypeHandlerBinder.cs | 35 ---------- .../DrawInspectorTypeHandlerBinder.cs.meta | 3 - .../HandlerMaps/GizmoTypeHandlerBinder.cs | 50 -------------- .../GizmoTypeHandlerBinder.cs.meta | 3 - .../ManipulateTypeHandlerBinder.cs | 41 ------------ .../ManipulateTypeHandlerBinder.cs.meta | 3 - Editor/Drawers/HandlerMaps/MiscBinder.cs | 67 ------------------- Editor/Drawers/HandlerMaps/MiscBinder.cs.meta | 3 - .../HandlerMaps/PreviewTypeHandlerBinder.cs | 40 ----------- .../PreviewTypeHandlerBinder.cs.meta | 3 - .../HandlerMaps/SelectTypeHandlerBinder.cs | 49 -------------- .../SelectTypeHandlerBinder.cs.meta | 3 - .../Handlers/InEditorModeHandler.cs | 6 ++ .../Handlers/InPlayModeHandler.cs | 6 ++ .../ManipulateUserConditionHandler.cs | 2 + .../Handlers/ReadOnlyFieldAttributeHandler.cs | 4 ++ .../Drawers/Manipulation/ManipulateDrawer.cs | 2 +- .../Misc/Handlers/CustomToolTipHandler.cs | 1 + .../Drawers/Misc/Handlers/DetailedHandler.cs | 3 + .../Misc/Handlers/EnumButtonsHandler.cs | 4 ++ .../Drawers/Misc/Handlers/HelpBoxHandler.cs | 2 + .../Drawers/Misc/Handlers/HideLabelHandler.cs | 2 + .../Misc/Handlers/RenameFieldHandler.cs | 1 + Editor/Drawers/Misc/MiscDrawer.cs | 2 +- .../Drawers/Preview/Handlers/AssetHandler.cs | 4 +- .../Drawers/Preview/Handlers/SpriteHandler.cs | 3 + .../Preview/Handlers/TextureHandler.cs | 3 + Editor/Drawers/Preview/PreviewDrawer.cs | 2 +- .../Select/Handlers/DropdownHandler.cs | 3 + .../Select/Handlers/SelectEnumHandler.cs | 3 + .../Handlers/SelectImplementationHandler.cs | 2 + .../Handlers/SelectSerializedTypeHandler.cs | 5 ++ Editor/Drawers/Select/SelectDrawer.cs | 2 +- .../Validation/Drawers/ValidationDrawer.cs | 2 +- .../Validation/Handlers/ClampWrapper.cs | 2 + .../Handlers/DataValidationHandler.cs | 2 + .../Validation/Handlers/FindHandler.cs | 2 + .../Drawers/Validation/Handlers/MaxWrapper.cs | 2 + .../Validation/Handlers/NotNullHandler.cs | 3 + .../Validation/Handlers/PrefabHandler.cs | 3 + .../Handlers/SceneReferenceHandler.cs | 3 + .../Validation/ValidationAttributeBinder.cs | 38 ----------- .../ValidationAttributeBinder.cs.meta | 3 - .../Manipulation/ManipulateAttribute.cs | 8 --- .../Manipulation/ManipulationMode.cs | 11 +++ .../Manipulation/ManipulationMode.cs.meta | 3 + package.json | 2 +- 59 files changed, 123 insertions(+), 363 deletions(-) delete mode 100644 Editor/Drawers/HandlerMaps.meta delete mode 100644 Editor/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs delete mode 100644 Editor/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs.meta delete mode 100644 Editor/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs delete mode 100644 Editor/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs.meta delete mode 100644 Editor/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs delete mode 100644 Editor/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs.meta delete mode 100644 Editor/Drawers/HandlerMaps/MiscBinder.cs delete mode 100644 Editor/Drawers/HandlerMaps/MiscBinder.cs.meta delete mode 100644 Editor/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs delete mode 100644 Editor/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs.meta delete mode 100644 Editor/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs delete mode 100644 Editor/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs.meta delete mode 100644 Editor/Drawers/Validation/ValidationAttributeBinder.cs delete mode 100644 Editor/Drawers/Validation/ValidationAttributeBinder.cs.meta create mode 100644 Runtime/Attributes/Manipulation/ManipulationMode.cs create mode 100644 Runtime/Attributes/Manipulation/ManipulationMode.cs.meta diff --git a/Editor/Drawers/DrawInspector/DrawInspectorDrawer.cs b/Editor/Drawers/DrawInspector/DrawInspectorDrawer.cs index 9482685..d791224 100644 --- a/Editor/Drawers/DrawInspector/DrawInspectorDrawer.cs +++ b/Editor/Drawers/DrawInspector/DrawInspectorDrawer.cs @@ -10,7 +10,7 @@ namespace Better.Attributes.EditorAddons.Drawers.DrawInspector { [CustomPropertyDrawer(typeof(DrawInspectorAttribute), true)] - public class DrawInspectorDrawer : BasePropertyDrawer + public class DrawInspectorDrawer : PropertyDrawer { protected override void PopulateContainer(ElementsContainer container) { diff --git a/Editor/Drawers/DrawInspector/DrawInspectorHandler.cs b/Editor/Drawers/DrawInspector/DrawInspectorHandler.cs index 13a206e..8e83248 100644 --- a/Editor/Drawers/DrawInspector/DrawInspectorHandler.cs +++ b/Editor/Drawers/DrawInspector/DrawInspectorHandler.cs @@ -1,7 +1,10 @@ using System; +using Better.Attributes.Runtime.DrawInspector; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Drawers.Handlers; using Better.Commons.EditorAddons.Extensions; using Better.Commons.EditorAddons.Utility; +using Better.Commons.Runtime.Comparers; using Better.Commons.Runtime.Extensions; using Better.Commons.Runtime.Utility; using UnityEditor; @@ -11,6 +14,7 @@ namespace Better.Attributes.EditorAddons.Drawers.DrawInspector { [Serializable] + [HandlerBinding(typeof(UnityEngine.Object), typeof(DrawInspectorAttribute))] public class DrawInspectorHandler : SerializedPropertyHandler { private SerializedProperty _property; diff --git a/Editor/Drawers/Gizmo/GizmoDrawer.cs b/Editor/Drawers/Gizmo/GizmoDrawer.cs index 6d6afb1..f3a6484 100644 --- a/Editor/Drawers/Gizmo/GizmoDrawer.cs +++ b/Editor/Drawers/Gizmo/GizmoDrawer.cs @@ -12,7 +12,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Gizmo { [CustomPropertyDrawer(typeof(BaseGizmoAttribute), true)] - public class GizmoDrawer : BasePropertyDrawer + public class GizmoDrawer : PropertyDrawer { public const string Hide = "Hide"; public const string Show = "Show"; diff --git a/Editor/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs b/Editor/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs index a8852ae..2868150 100644 --- a/Editor/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs +++ b/Editor/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs @@ -1,10 +1,13 @@ -using Better.Commons.EditorAddons.Extensions; +using Better.Attributes.Runtime.Gizmo; +using Better.Commons.EditorAddons.Drawers; +using Better.Commons.EditorAddons.Extensions; using Better.Commons.Runtime.Utility; using UnityEditor; using UnityEngine; namespace Better.Attributes.EditorAddons.Drawers.Gizmo { + [HandlerBinding(typeof(Bounds), typeof(GizmoLocalAttribute))] public class BoundsLocalHandler : BoundsBaseHandler { public override void Apply(SceneView sceneView) diff --git a/Editor/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs b/Editor/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs index 0cb8485..bdcb2a6 100644 --- a/Editor/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs +++ b/Editor/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs @@ -1,4 +1,6 @@ using System; +using Better.Attributes.Runtime.Gizmo; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Extensions; using Better.Commons.Runtime.Extensions; using UnityEditor; @@ -6,6 +8,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Gizmo { + [HandlerBinding(typeof(Quaternion), typeof(GizmoLocalAttribute))] public class QuaternionLocalHandler : GizmoHandler { private const float Size = 1.1f; diff --git a/Editor/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs b/Editor/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs index 827ffe5..418f31d 100644 --- a/Editor/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs +++ b/Editor/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs @@ -1,4 +1,6 @@ using System; +using Better.Attributes.Runtime.Gizmo; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Extensions; using Better.Commons.Runtime.Extensions; using UnityEditor; @@ -6,6 +8,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Gizmo { + [HandlerBinding(typeof(Vector2), typeof(GizmoLocalAttribute))] public class Vector2LocalHandler : GizmoHandler { private Vector2 _previousValue; diff --git a/Editor/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs b/Editor/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs index 6ed9451..b5c7028 100644 --- a/Editor/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs +++ b/Editor/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs @@ -1,4 +1,6 @@ using System; +using Better.Attributes.Runtime.Gizmo; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Extensions; using Better.Commons.Runtime.Extensions; using UnityEditor; @@ -6,6 +8,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Gizmo { + [HandlerBinding(typeof(Vector3), typeof(GizmoLocalAttribute))] public class Vector3LocalHandler : GizmoHandler { private Vector3 _previousValue; diff --git a/Editor/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs b/Editor/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs index fbf8fbf..b9795b2 100644 --- a/Editor/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs +++ b/Editor/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs @@ -1,8 +1,12 @@ -using Better.Commons.Runtime.Extensions; +using Better.Attributes.Runtime.Gizmo; +using Better.Commons.EditorAddons.Drawers; +using Better.Commons.Runtime.Extensions; using UnityEditor; +using UnityEngine; namespace Better.Attributes.EditorAddons.Drawers.Gizmo { + [HandlerBinding(typeof(Bounds), typeof(GizmoAttribute))] public class BoundsHandler : BoundsBaseHandler { public override void Apply(SceneView sceneView) diff --git a/Editor/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs b/Editor/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs index 0a0f5c0..14c017c 100644 --- a/Editor/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs +++ b/Editor/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs @@ -1,10 +1,13 @@ using System; +using Better.Attributes.Runtime.Gizmo; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.Runtime.Extensions; using UnityEditor; using UnityEngine; namespace Better.Attributes.EditorAddons.Drawers.Gizmo { + [HandlerBinding(typeof(Quaternion), typeof(GizmoAttribute))] public class QuaternionHandler : GizmoHandler { private const float Size = 1.1f; diff --git a/Editor/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs b/Editor/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs index ee70b8c..b2dc321 100644 --- a/Editor/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs +++ b/Editor/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs @@ -1,10 +1,13 @@ using System; +using Better.Attributes.Runtime.Gizmo; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.Runtime.Extensions; using UnityEditor; using UnityEngine; namespace Better.Attributes.EditorAddons.Drawers.Gizmo { + [HandlerBinding(typeof(Vector2), typeof(GizmoAttribute))] public class Vector2Handler : GizmoHandler { private Vector2 _previousValue; diff --git a/Editor/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs b/Editor/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs index 428b572..5e58cbd 100644 --- a/Editor/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs +++ b/Editor/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs @@ -1,10 +1,13 @@ using System; +using Better.Attributes.Runtime.Gizmo; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.Runtime.Extensions; using UnityEditor; using UnityEngine; namespace Better.Attributes.EditorAddons.Drawers.Gizmo { + [HandlerBinding(typeof(Vector3), typeof(GizmoAttribute))] public class Vector3Handler : GizmoHandler { private Vector3 _previousValue; diff --git a/Editor/Drawers/HandlerMaps.meta b/Editor/Drawers/HandlerMaps.meta deleted file mode 100644 index 38d715b..0000000 --- a/Editor/Drawers/HandlerMaps.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: e662470b67c43cf4cba3a441ad5d81cd -timeCreated: 1663379141 \ No newline at end of file diff --git a/Editor/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs b/Editor/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs deleted file mode 100644 index d2d67be..0000000 --- a/Editor/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using Better.Attributes.EditorAddons.Drawers.DrawInspector; -using Better.Attributes.Runtime.DrawInspector; -using Better.Commons.EditorAddons.Drawers.Handlers; -using Better.Commons.EditorAddons.Drawers.HandlersTypeCollection; -using Better.Commons.Runtime.Comparers; -using Object = UnityEngine.Object; - -namespace Better.Attributes.EditorAddons.Drawers.HandlerMaps -{ - [Binder(typeof(DrawInspectorHandler))] - public class DrawInspectorTypeHandlerBinder : TypeHandlerBinder - { - protected override BaseHandlersTypeCollection GenerateCollection() - { - return new HandlersTypeCollection() - { - { - typeof(DrawInspectorAttribute), new Dictionary(AssignableFromComparer.Instance) - { - { - typeof(Object), typeof(DrawInspectorHandler) - } - } - } - }; - } - - protected override HashSet GenerateAvailable() - { - return new HashSet(AssignableFromComparer.Instance) { typeof(Object) }; - } - } -} \ No newline at end of file diff --git a/Editor/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs.meta b/Editor/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs.meta deleted file mode 100644 index 41fc2b3..0000000 --- a/Editor/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: ab909d25eb40458181a1e1c991aa34b0 -timeCreated: 1667588792 \ No newline at end of file diff --git a/Editor/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs b/Editor/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs deleted file mode 100644 index afae42f..0000000 --- a/Editor/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections.Generic; -using Better.Attributes.EditorAddons.Drawers.Gizmo; -using Better.Attributes.Runtime.Gizmo; -using Better.Commons.EditorAddons.Drawers.Handlers; -using Better.Commons.EditorAddons.Drawers.HandlersTypeCollection; -using UnityEngine; - -namespace Better.Attributes.EditorAddons.Drawers.HandlerMaps -{ - [Binder(typeof(GizmoHandler))] - public class GizmoTypeHandlerBinder : TypeHandlerBinder - { - protected override BaseHandlersTypeCollection GenerateCollection() - { - return new HandlersTypeCollection() - { - { - typeof(GizmoLocalAttribute), new Dictionary() - { - { typeof(Vector3), typeof(Vector3LocalHandler) }, - { typeof(Vector2), typeof(Vector2LocalHandler) }, - { typeof(Quaternion), typeof(QuaternionLocalHandler) }, - { typeof(Bounds), typeof(BoundsLocalHandler) } - } - }, - { - typeof(GizmoAttribute), new Dictionary() - { - { typeof(Vector3), typeof(Vector3Handler) }, - { typeof(Vector2), typeof(Vector2Handler) }, - { typeof(Quaternion), typeof(QuaternionHandler) }, - { typeof(Bounds), typeof(BoundsHandler) } - } - } - }; - } - - protected override HashSet GenerateAvailable() - { - return new HashSet() - { - typeof(Vector3), - typeof(Vector2), - typeof(Quaternion), - typeof(Bounds) - }; - } - } -} \ No newline at end of file diff --git a/Editor/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs.meta b/Editor/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs.meta deleted file mode 100644 index 2d5fe09..0000000 --- a/Editor/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: aac722e5ac7df2f4e94791c4207a4a04 -timeCreated: 1658863143 \ No newline at end of file diff --git a/Editor/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs b/Editor/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs deleted file mode 100644 index ced1c32..0000000 --- a/Editor/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using Better.Attributes.EditorAddons.Drawers.Manipulation; -using Better.Attributes.Runtime.Manipulation; -using Better.Commons.EditorAddons.Drawers.Handlers; -using Better.Commons.EditorAddons.Drawers.HandlersTypeCollection; -using Better.Commons.Runtime.Comparers; - -namespace Better.Attributes.EditorAddons.Drawers.HandlerMaps -{ - [Binder(typeof(ManipulateHandler))] - public class ManipulateTypeHandlerBinder : TypeHandlerBinder - { - protected override BaseHandlersTypeCollection GenerateCollection() - { - return new AttributeHandlersTypeCollection(AssignableFromComparer.Instance) - { - { typeof(ManipulateUserConditionAttribute), typeof(ManipulateUserConditionHandler) }, - { typeof(DisableInEditorModeAttribute), typeof(InEditorModeHandler) }, - { typeof(DisableInPlayModeAttribute), typeof(InPlayModeHandler) }, - { typeof(EnableInEditorModeAttribute), typeof(InEditorModeHandler)}, - { typeof(EnableInPlayModeAttribute), typeof(InPlayModeHandler) }, - { typeof(ShowInPlayModeAttribute), typeof(InPlayModeHandler) }, - { typeof(ShowInEditorModeAttribute), typeof(InEditorModeHandler) }, - { typeof(HideInPlayModeAttribute), typeof(InPlayModeHandler) }, - { typeof(HideInEditorModeAttribute), typeof(InEditorModeHandler) }, - { typeof(ReadOnlyAttribute), typeof(ReadOnlyFieldAttributeHandler) }, - }; - } - - protected override HashSet GenerateAvailable() - { - return new HashSet(); - } - - public override bool IsSupported(Type type) - { - return true; - } - } -} \ No newline at end of file diff --git a/Editor/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs.meta b/Editor/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs.meta deleted file mode 100644 index 2c1e6ae..0000000 --- a/Editor/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 0bddbcb5ff3d47588db19ce91b009e1b -timeCreated: 1688642149 \ No newline at end of file diff --git a/Editor/Drawers/HandlerMaps/MiscBinder.cs b/Editor/Drawers/HandlerMaps/MiscBinder.cs deleted file mode 100644 index 997b31a..0000000 --- a/Editor/Drawers/HandlerMaps/MiscBinder.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.Collections.Generic; -using Better.Attributes.EditorAddons.Comparers; -using Better.Attributes.EditorAddons.Drawers.Misc; -using Better.Attributes.Runtime.Misc; -using Better.Commons.EditorAddons.Drawers.Handlers; -using Better.Commons.EditorAddons.Drawers.HandlersTypeCollection; -using Better.Commons.Runtime.Comparers; - -namespace Better.Attributes.EditorAddons.Drawers.HandlerMaps -{ - [Binder(typeof(MiscHandler))] - public class MiscBinder : TypeHandlerBinder - { - protected override BaseHandlersTypeCollection GenerateCollection() - { - return new HandlersTypeCollection(TypeComparer.Instance) - { - { - typeof(HideLabelAttribute), new Dictionary(AnyTypeComparer.Instance) - { - { typeof(Type), typeof(HideLabelHandler) } - } - }, - { - typeof(EnumButtonsAttribute), new Dictionary(AssignableFromComparer.Instance) - { - { typeof(Enum), typeof(EnumButtonsHandler) } - } - }, - { - typeof(CustomTooltipAttribute), new Dictionary(AnyTypeComparer.Instance) - { - { typeof(Type), typeof(CustomToolTipHandler) } - } - }, - { - typeof(HelpBoxAttribute), new Dictionary(AnyTypeComparer.Instance) - { - { typeof(Type), typeof(HelpBoxHandler) } - } - }, - { - typeof(RenameFieldAttribute), new Dictionary(AnyTypeComparer.Instance) - { - { typeof(Type), typeof(RenameFieldHandler) } - } - }, - { - typeof(DetailedAttribute), new Dictionary(AnyTypeComparer.Instance) - { - { typeof(Type), typeof(DetailedHandler) } - } - }, - }; - } - - protected override HashSet GenerateAvailable() - { - return new HashSet(AnyTypeComparer.Instance) - { - typeof(Enum), - typeof(Type) - }; - } - } -} \ No newline at end of file diff --git a/Editor/Drawers/HandlerMaps/MiscBinder.cs.meta b/Editor/Drawers/HandlerMaps/MiscBinder.cs.meta deleted file mode 100644 index 0ebfac6..0000000 --- a/Editor/Drawers/HandlerMaps/MiscBinder.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: e178257774c94fdaba4940ff43924508 -timeCreated: 1690172625 \ No newline at end of file diff --git a/Editor/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs b/Editor/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs deleted file mode 100644 index 5cc6924..0000000 --- a/Editor/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using Better.Attributes.EditorAddons.Drawers.Preview; -using Better.Attributes.Runtime.Preview; -using Better.Commons.EditorAddons.Drawers.Handlers; -using Better.Commons.EditorAddons.Drawers.HandlersTypeCollection; -using Better.Commons.Runtime.Comparers; -using UnityEngine; - -namespace Better.Attributes.EditorAddons.Drawers.HandlerMaps -{ - [Binder(typeof(PreviewHandler))] - public class PreviewTypeHandlerBinder : TypeHandlerBinder - { - protected override BaseHandlersTypeCollection GenerateCollection() - { - return new HandlersTypeCollection() - { - { - typeof(PreviewAttribute), new Dictionary(AssignableFromComparer.Instance) - { - { typeof(Sprite), typeof(SpriteHandler) }, - { typeof(Texture2D), typeof(TextureHandler) }, - { typeof(Component), typeof(AssetHandler) } - } - } - }; - } - - protected override HashSet GenerateAvailable() - { - return new HashSet(AssignableFromComparer.Instance) - { - typeof(Sprite), - typeof(Texture), - typeof(Component) - }; - } - } -} \ No newline at end of file diff --git a/Editor/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs.meta b/Editor/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs.meta deleted file mode 100644 index a2afcb8..0000000 --- a/Editor/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: aad5d57aec45ea34b8592c9c4221d84f -timeCreated: 1663071014 \ No newline at end of file diff --git a/Editor/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs b/Editor/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs deleted file mode 100644 index 396184a..0000000 --- a/Editor/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using Better.Attributes.EditorAddons.Comparers; -using Better.Attributes.EditorAddons.Drawers.Select; -using Better.Attributes.Runtime.Select; -using Better.Commons.EditorAddons.Drawers.Handlers; -using Better.Commons.EditorAddons.Drawers.HandlersTypeCollection; -using Better.Commons.Runtime.Comparers; -using Better.Commons.Runtime.DataStructures.SerializedTypes; - -#pragma warning disable CS0618 - -namespace Better.Attributes.EditorAddons.Drawers.HandlerMaps -{ - [Binder(typeof(BaseSelectHandler))] - public class SelectTypeHandlerBinder : TypeHandlerBinder - { - protected override BaseHandlersTypeCollection GenerateCollection() - { - return new HandlersTypeCollection(TypeComparer.Instance) - { - { - typeof(SelectAttribute), new Dictionary(SelectImplementationTypeComparer.Instance) - { - { typeof(SerializedType), typeof(SelectSerializedTypeHandler) }, - { typeof(Enum), typeof(SelectEnumHandler) }, - { typeof(Type), typeof(SelectImplementationHandler) } - } - }, - { - typeof(DropdownAttribute), new Dictionary(AnyTypeComparer.Instance) - { - { typeof(Type), typeof(DropdownHandler) } - } - } - }; - } - - protected override HashSet GenerateAvailable() - { - return new HashSet(AnyTypeComparer.Instance) - { - typeof(Enum), - typeof(Type), - typeof(SerializedType) - }; - } - } -} \ No newline at end of file diff --git a/Editor/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs.meta b/Editor/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs.meta deleted file mode 100644 index fd08c57..0000000 --- a/Editor/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: bb61332dd49642dd9ce7388fefb4d68c -timeCreated: 1665878415 \ No newline at end of file diff --git a/Editor/Drawers/Manipulation/Handlers/InEditorModeHandler.cs b/Editor/Drawers/Manipulation/Handlers/InEditorModeHandler.cs index 54eaada..baf4eef 100644 --- a/Editor/Drawers/Manipulation/Handlers/InEditorModeHandler.cs +++ b/Editor/Drawers/Manipulation/Handlers/InEditorModeHandler.cs @@ -1,7 +1,13 @@ +using Better.Attributes.Runtime.Manipulation; +using Better.Commons.EditorAddons.Drawers; using UnityEditor; namespace Better.Attributes.EditorAddons.Drawers.Manipulation { + [HandlerBinding(typeof(DisableInEditorModeAttribute))] + [HandlerBinding(typeof(EnableInEditorModeAttribute))] + [HandlerBinding(typeof(ShowInEditorModeAttribute))] + [HandlerBinding(typeof(HideInEditorModeAttribute))] public class InEditorModeHandler : ManipulateHandler { protected override bool IsConditionSatisfied() diff --git a/Editor/Drawers/Manipulation/Handlers/InPlayModeHandler.cs b/Editor/Drawers/Manipulation/Handlers/InPlayModeHandler.cs index e404b1c..d850abb 100644 --- a/Editor/Drawers/Manipulation/Handlers/InPlayModeHandler.cs +++ b/Editor/Drawers/Manipulation/Handlers/InPlayModeHandler.cs @@ -1,7 +1,13 @@ +using Better.Attributes.Runtime.Manipulation; +using Better.Commons.EditorAddons.Drawers; using UnityEditor; namespace Better.Attributes.EditorAddons.Drawers.Manipulation { + [HandlerBinding(typeof(DisableInPlayModeAttribute))] + [HandlerBinding(typeof(EnableInPlayModeAttribute))] + [HandlerBinding(typeof(ShowInPlayModeAttribute))] + [HandlerBinding(typeof(HideInPlayModeAttribute))] public class InPlayModeHandler : ManipulateHandler { protected override bool IsConditionSatisfied() diff --git a/Editor/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs b/Editor/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs index 23c022f..f06bb57 100644 --- a/Editor/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs +++ b/Editor/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs @@ -1,6 +1,7 @@ using System; using System.Reflection; using Better.Attributes.Runtime.Manipulation; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Extensions; using Better.Commons.Runtime.Extensions; using Better.Internal.Core.Runtime; @@ -8,6 +9,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Manipulation { + [HandlerBinding(typeof(ManipulateUserConditionAttribute))] public class ManipulateUserConditionHandler : ManipulateHandler { private ManipulateUserConditionAttribute _userAttribute; diff --git a/Editor/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs b/Editor/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs index 400b9c4..2c61f93 100644 --- a/Editor/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs +++ b/Editor/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs @@ -1,5 +1,9 @@ +using Better.Attributes.Runtime.Manipulation; +using Better.Commons.EditorAddons.Drawers; + namespace Better.Attributes.EditorAddons.Drawers.Manipulation { + [HandlerBinding(typeof(ReadOnlyAttribute))] public class ReadOnlyFieldAttributeHandler : ManipulateHandler { protected override bool IsConditionSatisfied() diff --git a/Editor/Drawers/Manipulation/ManipulateDrawer.cs b/Editor/Drawers/Manipulation/ManipulateDrawer.cs index 6b93afd..d5e1b29 100644 --- a/Editor/Drawers/Manipulation/ManipulateDrawer.cs +++ b/Editor/Drawers/Manipulation/ManipulateDrawer.cs @@ -6,7 +6,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Manipulation { [CustomPropertyDrawer(typeof(ManipulateAttribute), true)] - public class ManipulateDrawer : BasePropertyDrawer + public class ManipulateDrawer : PropertyDrawer { protected override void PopulateContainer(ElementsContainer container) { diff --git a/Editor/Drawers/Misc/Handlers/CustomToolTipHandler.cs b/Editor/Drawers/Misc/Handlers/CustomToolTipHandler.cs index bc57663..700c541 100644 --- a/Editor/Drawers/Misc/Handlers/CustomToolTipHandler.cs +++ b/Editor/Drawers/Misc/Handlers/CustomToolTipHandler.cs @@ -6,6 +6,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Misc { + [HandlerBinding(typeof(CustomTooltipAttribute))] public class CustomToolTipHandler : MiscLabelHandler { protected override void OnUpdateLabel(LabelContainer labelContainer) diff --git a/Editor/Drawers/Misc/Handlers/DetailedHandler.cs b/Editor/Drawers/Misc/Handlers/DetailedHandler.cs index 85d814e..2184b49 100644 --- a/Editor/Drawers/Misc/Handlers/DetailedHandler.cs +++ b/Editor/Drawers/Misc/Handlers/DetailedHandler.cs @@ -5,6 +5,7 @@ using Better.Attributes.EditorAddons.CustomEditors; using Better.Attributes.EditorAddons.Drawers.EditorButton; using Better.Attributes.Runtime.Misc; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Drawers.Container; using Better.Commons.EditorAddons.Extensions; using Better.Commons.EditorAddons.Helpers; @@ -18,6 +19,8 @@ namespace Better.Attributes.EditorAddons.Drawers.Misc { //TODO: add parameters + + [HandlerBinding(typeof(DetailedAttribute))] public class DetailedHandler : MiscHandler { private DetailedAttribute _detailedAttribute; diff --git a/Editor/Drawers/Misc/Handlers/EnumButtonsHandler.cs b/Editor/Drawers/Misc/Handlers/EnumButtonsHandler.cs index 46d1e40..23f3d0b 100644 --- a/Editor/Drawers/Misc/Handlers/EnumButtonsHandler.cs +++ b/Editor/Drawers/Misc/Handlers/EnumButtonsHandler.cs @@ -1,5 +1,7 @@ using System; using System.Reflection; +using Better.Attributes.Runtime.Misc; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Extensions; using Better.Commons.EditorAddons.Utility; using Better.Commons.Runtime.Extensions; @@ -9,6 +11,8 @@ namespace Better.Attributes.EditorAddons.Drawers.Misc { + + [HandlerBinding(typeof(Enum), typeof(EnumButtonsAttribute))] public class EnumButtonsHandler : MiscHandler { private Enum _enum; diff --git a/Editor/Drawers/Misc/Handlers/HelpBoxHandler.cs b/Editor/Drawers/Misc/Handlers/HelpBoxHandler.cs index 70ba329..7c35a5c 100644 --- a/Editor/Drawers/Misc/Handlers/HelpBoxHandler.cs +++ b/Editor/Drawers/Misc/Handlers/HelpBoxHandler.cs @@ -1,11 +1,13 @@ using System; using Better.Attributes.Runtime.Misc; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Extensions; using Better.Commons.EditorAddons.Utility; using UnityEngine.UIElements; namespace Better.Attributes.EditorAddons.Drawers.Misc { + [HandlerBinding(typeof(HelpBoxAttribute))] public class HelpBoxHandler : MiscHandler { protected override void OnSetupContainer() diff --git a/Editor/Drawers/Misc/Handlers/HideLabelHandler.cs b/Editor/Drawers/Misc/Handlers/HideLabelHandler.cs index 6dc0f65..b658d16 100644 --- a/Editor/Drawers/Misc/Handlers/HideLabelHandler.cs +++ b/Editor/Drawers/Misc/Handlers/HideLabelHandler.cs @@ -1,3 +1,4 @@ +using Better.Attributes.Runtime.Misc; using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Drawers.Container; using Better.Commons.EditorAddons.Extensions; @@ -7,6 +8,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Misc { + [HandlerBinding(typeof(HideLabelAttribute))] public class HideLabelHandler : MiscLabelHandler { protected override void OnUpdateLabel(LabelContainer labelContainer) diff --git a/Editor/Drawers/Misc/Handlers/RenameFieldHandler.cs b/Editor/Drawers/Misc/Handlers/RenameFieldHandler.cs index 7048b7a..2999d70 100644 --- a/Editor/Drawers/Misc/Handlers/RenameFieldHandler.cs +++ b/Editor/Drawers/Misc/Handlers/RenameFieldHandler.cs @@ -4,6 +4,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Misc { + [HandlerBinding(typeof(RenameFieldAttribute))] public class RenameFieldHandler : MiscLabelHandler { protected override void OnUpdateLabel(LabelContainer labelContainer) diff --git a/Editor/Drawers/Misc/MiscDrawer.cs b/Editor/Drawers/Misc/MiscDrawer.cs index a63e1d7..f2b58dc 100644 --- a/Editor/Drawers/Misc/MiscDrawer.cs +++ b/Editor/Drawers/Misc/MiscDrawer.cs @@ -6,7 +6,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Misc { [CustomPropertyDrawer(typeof(MiscAttribute), true)] - public class MiscDrawer : BasePropertyDrawer + public class MiscDrawer : PropertyDrawer { protected override void PopulateContainer(ElementsContainer container) { diff --git a/Editor/Drawers/Preview/Handlers/AssetHandler.cs b/Editor/Drawers/Preview/Handlers/AssetHandler.cs index 223a9d6..c6af8af 100644 --- a/Editor/Drawers/Preview/Handlers/AssetHandler.cs +++ b/Editor/Drawers/Preview/Handlers/AssetHandler.cs @@ -1,4 +1,5 @@ -using Better.Commons.EditorAddons.Drawers; +using Better.Attributes.Runtime.Preview; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Drawers.Container; using Better.Commons.EditorAddons.Extensions; using Better.Commons.Runtime.Extensions; @@ -9,6 +10,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Preview { + [HandlerBinding(typeof(Component),typeof(PreviewAttribute))] public class AssetHandler : PreviewHandler { private const string ObjectNotSupportedMessage = "Object is not Component"; diff --git a/Editor/Drawers/Preview/Handlers/SpriteHandler.cs b/Editor/Drawers/Preview/Handlers/SpriteHandler.cs index 82b810e..dc63a5e 100644 --- a/Editor/Drawers/Preview/Handlers/SpriteHandler.cs +++ b/Editor/Drawers/Preview/Handlers/SpriteHandler.cs @@ -1,9 +1,12 @@ using Better.Attributes.EditorAddons.Extensions; +using Better.Attributes.Runtime.Preview; +using Better.Commons.EditorAddons.Drawers; using UnityEngine; using UnityEngine.SceneManagement; namespace Better.Attributes.EditorAddons.Drawers.Preview { + [HandlerBinding(typeof(Sprite),typeof(PreviewAttribute))] public class SpriteHandler : PreviewHandler { private protected override Texture GenerateTexture(Object drawnObject, float size) diff --git a/Editor/Drawers/Preview/Handlers/TextureHandler.cs b/Editor/Drawers/Preview/Handlers/TextureHandler.cs index 4bde231..ab3050e 100644 --- a/Editor/Drawers/Preview/Handlers/TextureHandler.cs +++ b/Editor/Drawers/Preview/Handlers/TextureHandler.cs @@ -1,9 +1,12 @@ using Better.Attributes.EditorAddons.Extensions; +using Better.Attributes.Runtime.Preview; +using Better.Commons.EditorAddons.Drawers; using UnityEngine; using UnityEngine.SceneManagement; namespace Better.Attributes.EditorAddons.Drawers.Preview { + [HandlerBinding(typeof(Texture2D),typeof(PreviewAttribute))] public class TextureHandler : PreviewHandler { private protected override Texture GenerateTexture(Object drawnObject, float size) diff --git a/Editor/Drawers/Preview/PreviewDrawer.cs b/Editor/Drawers/Preview/PreviewDrawer.cs index c3ba3ef..0e70c30 100644 --- a/Editor/Drawers/Preview/PreviewDrawer.cs +++ b/Editor/Drawers/Preview/PreviewDrawer.cs @@ -11,7 +11,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Preview { [CustomPropertyDrawer(typeof(PreviewAttribute))] - public class PreviewDrawer : BasePropertyDrawer + public class PreviewDrawer : PropertyDrawer { protected override void PopulateContainer(ElementsContainer container) { diff --git a/Editor/Drawers/Select/Handlers/DropdownHandler.cs b/Editor/Drawers/Select/Handlers/DropdownHandler.cs index 4255d34..3973ebd 100644 --- a/Editor/Drawers/Select/Handlers/DropdownHandler.cs +++ b/Editor/Drawers/Select/Handlers/DropdownHandler.cs @@ -2,10 +2,12 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Better.Attributes.EditorAddons.Comparers; using Better.Attributes.EditorAddons.Extensions; using Better.Attributes.Runtime; using Better.Attributes.Runtime.Select; using Better.Attributes.Runtime.Utilities; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Extensions; using Better.Commons.EditorAddons.Utility; using Better.Commons.Runtime.Comparers; @@ -16,6 +18,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Select { + [HandlerBinding(typeof(DropdownAttribute))] public class DropdownHandler : BaseSelectHandler { private IDataCollection _collection = new NoneCollection(); diff --git a/Editor/Drawers/Select/Handlers/SelectEnumHandler.cs b/Editor/Drawers/Select/Handlers/SelectEnumHandler.cs index a3ac679..0ca2493 100644 --- a/Editor/Drawers/Select/Handlers/SelectEnumHandler.cs +++ b/Editor/Drawers/Select/Handlers/SelectEnumHandler.cs @@ -2,10 +2,12 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using Better.Attributes.EditorAddons.Comparers; using Better.Attributes.EditorAddons.Extensions; using Better.Attributes.Runtime; using Better.Attributes.Runtime.Select; using Better.Attributes.Runtime.Utilities; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Extensions; using Better.Commons.Runtime.Extensions; using Better.Commons.Runtime.Utility; @@ -14,6 +16,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Select { + [HandlerBinding(typeof(Enum), typeof(SelectAttribute))] public class SelectEnumHandler : BaseSelectHandler { private Type _enumType; diff --git a/Editor/Drawers/Select/Handlers/SelectImplementationHandler.cs b/Editor/Drawers/Select/Handlers/SelectImplementationHandler.cs index 7359a68..7c852ce 100644 --- a/Editor/Drawers/Select/Handlers/SelectImplementationHandler.cs +++ b/Editor/Drawers/Select/Handlers/SelectImplementationHandler.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Better.Attributes.Runtime.Select; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Enums; using Better.Commons.EditorAddons.Extensions; using Better.Commons.Runtime.Extensions; @@ -9,6 +10,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Select { + [HandlerBinding(typeof(SelectAttribute))] public class SelectImplementationHandler : BaseSelectTypeHandler { protected override void OnSetup() diff --git a/Editor/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs b/Editor/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs index 7ba490c..1532d5e 100644 --- a/Editor/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs +++ b/Editor/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs @@ -2,10 +2,13 @@ using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; +using Better.Attributes.EditorAddons.Comparers; using Better.Attributes.EditorAddons.Extensions; using Better.Attributes.Runtime; +using Better.Attributes.Runtime.DrawInspector; using Better.Attributes.Runtime.Select; using Better.Attributes.Runtime.Utilities; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Extensions; using Better.Commons.EditorAddons.Utility; using Better.Commons.Runtime.DataStructures.SerializedTypes; @@ -16,6 +19,8 @@ namespace Better.Attributes.EditorAddons.Drawers.Select { + + [HandlerBinding(typeof(SerializedType), typeof(SelectAttribute))] public class SelectSerializedTypeHandler : BaseSelectTypeHandler { protected override void OnSetup() diff --git a/Editor/Drawers/Select/SelectDrawer.cs b/Editor/Drawers/Select/SelectDrawer.cs index 22f7b5c..6e00d5c 100644 --- a/Editor/Drawers/Select/SelectDrawer.cs +++ b/Editor/Drawers/Select/SelectDrawer.cs @@ -16,7 +16,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Select { [CustomPropertyDrawer(typeof(SelectAttribute), true)] [CustomPropertyDrawer(typeof(DropdownAttribute), true)] - public class SelectDrawer : BasePropertyDrawer + public class SelectDrawer : PropertyDrawer { //TODO: Consider to use Locators private Dictionary> _behavioredElements; diff --git a/Editor/Drawers/Validation/Drawers/ValidationDrawer.cs b/Editor/Drawers/Validation/Drawers/ValidationDrawer.cs index 5a2addd..127191d 100644 --- a/Editor/Drawers/Validation/Drawers/ValidationDrawer.cs +++ b/Editor/Drawers/Validation/Drawers/ValidationDrawer.cs @@ -10,7 +10,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Validation.Drawers { [CustomPropertyDrawer(typeof(ValidationAttribute), true)] - public class ValidationDrawer : BasePropertyDrawer + public class ValidationDrawer : PropertyDrawer { protected override void PopulateContainer(ElementsContainer container) { diff --git a/Editor/Drawers/Validation/Handlers/ClampWrapper.cs b/Editor/Drawers/Validation/Handlers/ClampWrapper.cs index 2c6d63e..94286d4 100644 --- a/Editor/Drawers/Validation/Handlers/ClampWrapper.cs +++ b/Editor/Drawers/Validation/Handlers/ClampWrapper.cs @@ -1,5 +1,6 @@ using System; using Better.Attributes.Runtime.Validation; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Extensions; using UnityEditor; using UnityEngine; @@ -7,6 +8,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Validation.Handlers { [Serializable] + [HandlerBinding(typeof(ClampAttribute))] public class ClampWrapper : PropertyValidationHandler { public override bool IsSupported() diff --git a/Editor/Drawers/Validation/Handlers/DataValidationHandler.cs b/Editor/Drawers/Validation/Handlers/DataValidationHandler.cs index f38073b..4042dab 100644 --- a/Editor/Drawers/Validation/Handlers/DataValidationHandler.cs +++ b/Editor/Drawers/Validation/Handlers/DataValidationHandler.cs @@ -1,6 +1,7 @@ using System; using System.Reflection; using Better.Attributes.Runtime.Validation; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Extensions; using Better.Commons.EditorAddons.Helpers; using Better.Commons.Runtime.Extensions; @@ -9,6 +10,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Validation.Handlers { [Serializable] + [HandlerBinding(typeof(DataValidationAttribute))] public class DataValidationHandler : PropertyValidationHandler { public override ValidationValue Validate() diff --git a/Editor/Drawers/Validation/Handlers/FindHandler.cs b/Editor/Drawers/Validation/Handlers/FindHandler.cs index b0dc034..ca395d1 100644 --- a/Editor/Drawers/Validation/Handlers/FindHandler.cs +++ b/Editor/Drawers/Validation/Handlers/FindHandler.cs @@ -1,5 +1,6 @@ using System; using Better.Attributes.Runtime.Validation; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.Runtime.Extensions; using UnityEditor; using UnityEngine; @@ -7,6 +8,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Validation.Handlers { [Serializable] + [HandlerBinding(typeof(FindAttribute))] public class FindHandler : PropertyValidationHandler { private FindAttribute _findAttribute; diff --git a/Editor/Drawers/Validation/Handlers/MaxWrapper.cs b/Editor/Drawers/Validation/Handlers/MaxWrapper.cs index 4fea823..8c6e95c 100644 --- a/Editor/Drawers/Validation/Handlers/MaxWrapper.cs +++ b/Editor/Drawers/Validation/Handlers/MaxWrapper.cs @@ -1,11 +1,13 @@ using System; using Better.Attributes.Runtime.Validation; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Extensions; using UnityEditor; namespace Better.Attributes.EditorAddons.Drawers.Validation.Handlers { [Serializable] + [HandlerBinding(typeof(MaxAttribute))] public class MaxWrapper : PropertyValidationHandler { public override bool IsSupported() diff --git a/Editor/Drawers/Validation/Handlers/NotNullHandler.cs b/Editor/Drawers/Validation/Handlers/NotNullHandler.cs index 7379d2f..59ed346 100644 --- a/Editor/Drawers/Validation/Handlers/NotNullHandler.cs +++ b/Editor/Drawers/Validation/Handlers/NotNullHandler.cs @@ -1,10 +1,13 @@ using System; +using Better.Attributes.Runtime.Validation; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.Runtime.Extensions; using UnityEditor; namespace Better.Attributes.EditorAddons.Drawers.Validation.Handlers { [Serializable] + [HandlerBinding(typeof(NotNullAttribute))] public class NotNullHandler : PropertyValidationHandler { public override ValidationValue Validate() diff --git a/Editor/Drawers/Validation/Handlers/PrefabHandler.cs b/Editor/Drawers/Validation/Handlers/PrefabHandler.cs index 03fd093..33fa950 100644 --- a/Editor/Drawers/Validation/Handlers/PrefabHandler.cs +++ b/Editor/Drawers/Validation/Handlers/PrefabHandler.cs @@ -1,10 +1,13 @@ using System; +using Better.Attributes.Runtime.Validation; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.Runtime.Extensions; using UnityEditor; namespace Better.Attributes.EditorAddons.Drawers.Validation.Handlers { [Serializable] + [HandlerBinding(typeof(PrefabReferenceAttribute))] public class PrefabHandler : NotNullHandler { public override ValidationValue Validate() diff --git a/Editor/Drawers/Validation/Handlers/SceneReferenceHandler.cs b/Editor/Drawers/Validation/Handlers/SceneReferenceHandler.cs index ccaf78f..888be0d 100644 --- a/Editor/Drawers/Validation/Handlers/SceneReferenceHandler.cs +++ b/Editor/Drawers/Validation/Handlers/SceneReferenceHandler.cs @@ -1,4 +1,6 @@ using System; +using Better.Attributes.Runtime.Validation; +using Better.Commons.EditorAddons.Drawers; using Better.Commons.Runtime.Extensions; using UnityEditor; using UnityEngine; @@ -7,6 +9,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Validation.Handlers { [Serializable] + [HandlerBinding(typeof(SceneReferenceAttribute))] public class SceneReferenceHandler : NotNullHandler { public override ValidationValue Validate() diff --git a/Editor/Drawers/Validation/ValidationAttributeBinder.cs b/Editor/Drawers/Validation/ValidationAttributeBinder.cs deleted file mode 100644 index 8fb1612..0000000 --- a/Editor/Drawers/Validation/ValidationAttributeBinder.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using Better.Attributes.EditorAddons.Drawers.Validation.Handlers; -using Better.Attributes.Runtime.Validation; -using Better.Commons.EditorAddons.Drawers.Handlers; -using Better.Commons.EditorAddons.Drawers.HandlersTypeCollection; -using Better.Commons.Runtime.Comparers; - -namespace Better.Attributes.EditorAddons.Drawers.Validation -{ - [Binder(typeof(PropertyValidationHandler))] - public class ValidationAttributeBinder : TypeHandlerBinder - { - protected override BaseHandlersTypeCollection GenerateCollection() - { - return new AttributeHandlersTypeCollection(AssignableFromComparer.Instance) - { - { typeof(NotNullAttribute), typeof(NotNullHandler) }, - { typeof(PrefabReferenceAttribute), typeof(PrefabHandler) }, - { typeof(SceneReferenceAttribute), typeof(SceneReferenceHandler) }, - { typeof(FindAttribute), typeof(FindHandler) }, - { typeof(DataValidationAttribute), typeof(DataValidationHandler) }, - { typeof(MaxAttribute), typeof(MaxWrapper) }, - { typeof(ClampAttribute), typeof(ClampWrapper) }, - }; - } - - public override bool IsSupported(Type type) - { - return true; - } - - protected override HashSet GenerateAvailable() - { - return new HashSet(); - } - } -} \ No newline at end of file diff --git a/Editor/Drawers/Validation/ValidationAttributeBinder.cs.meta b/Editor/Drawers/Validation/ValidationAttributeBinder.cs.meta deleted file mode 100644 index 2ca5bfc..0000000 --- a/Editor/Drawers/Validation/ValidationAttributeBinder.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 35cadd1878174f5b958144d8b53a3e11 -timeCreated: 1680610178 \ No newline at end of file diff --git a/Runtime/Attributes/Manipulation/ManipulateAttribute.cs b/Runtime/Attributes/Manipulation/ManipulateAttribute.cs index 59b8214..073f57d 100644 --- a/Runtime/Attributes/Manipulation/ManipulateAttribute.cs +++ b/Runtime/Attributes/Manipulation/ManipulateAttribute.cs @@ -5,14 +5,6 @@ namespace Better.Attributes.Runtime.Manipulation { - public enum ManipulationMode - { - Show, - Hide, - Disable, - Enable - } - [Conditional(Defines.Editor)] [AttributeUsage(AttributeTargets.Field)] public abstract class ManipulateAttribute : MultiPropertyAttribute diff --git a/Runtime/Attributes/Manipulation/ManipulationMode.cs b/Runtime/Attributes/Manipulation/ManipulationMode.cs new file mode 100644 index 0000000..fd4960c --- /dev/null +++ b/Runtime/Attributes/Manipulation/ManipulationMode.cs @@ -0,0 +1,11 @@ +namespace Better.Attributes.Runtime.Manipulation +{ + //TODO: change file placement + public enum ManipulationMode + { + Show, + Hide, + Disable, + Enable + } +} \ No newline at end of file diff --git a/Runtime/Attributes/Manipulation/ManipulationMode.cs.meta b/Runtime/Attributes/Manipulation/ManipulationMode.cs.meta new file mode 100644 index 0000000..57f8a17 --- /dev/null +++ b/Runtime/Attributes/Manipulation/ManipulationMode.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f5d0c818c8e54ae2a1ca7baceaa3dfaa +timeCreated: 1733013724 \ No newline at end of file diff --git a/package.json b/package.json index baf7c7d..1e9612b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "com.tdw.better.attributes", "displayName": "Better Attributes", - "version": "0.0.3", + "version": "0.0.4", "unity": "2021.3", "description": "Unity attributes, allows to serialize interfaces, draw handles for Vector3/Vector2/Quaternion/Bounds, create read only fields.", "dependencies": {