From b2b9ec6888f16055d12f6099696ef79ef624f5e8 Mon Sep 17 00:00:00 2001 From: uurha Date: Mon, 2 Sep 2024 22:51:51 +0200 Subject: [PATCH 1/7] Add ignoring not Serializable types --- .../Drawers/Select/Handlers/SelectImplementationHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectImplementationHandler.cs b/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectImplementationHandler.cs index f47aed1..f649ece 100644 --- a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectImplementationHandler.cs +++ b/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectImplementationHandler.cs @@ -38,7 +38,7 @@ public override object GetCurrentValue() protected override IEnumerable GetInheritedTypes(Type fieldType) { var inheritedTypes = fieldType.GetAllInheritedTypesWithoutUnityObject() - .Where(type => !type.IsGenericType && !type.IsGenericTypeDefinition); + .Where(type => !type.IsGenericType && !type.IsGenericTypeDefinition && type.IsDefined(typeof(SerializableAttribute), false)); return inheritedTypes; } From 6588bdb54238cdc10041fd730616f06767907e2f Mon Sep 17 00:00:00 2001 From: uurha Date: Mon, 2 Sep 2024 23:52:05 +0200 Subject: [PATCH 2/7] Fix Find attribute drawer --- .../EditorAddons/Drawers/Validation/Drawers/ValidationDrawer.cs | 2 +- .../Handlers/{FindComponentHandler.cs => FindHandler.cs} | 2 +- .../{FindComponentHandler.cs.meta => FindHandler.cs.meta} | 0 .../Drawers/Validation/ValidationAttributeBinder.cs | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/{FindComponentHandler.cs => FindHandler.cs} (97%) rename Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/{FindComponentHandler.cs.meta => FindHandler.cs.meta} (100%) diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Drawers/ValidationDrawer.cs b/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Drawers/ValidationDrawer.cs index 8167d1f..5a2addd 100644 --- a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Drawers/ValidationDrawer.cs +++ b/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Drawers/ValidationDrawer.cs @@ -9,7 +9,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Validation.Drawers { - [CustomPropertyDrawer(typeof(ValidationAttribute))] + [CustomPropertyDrawer(typeof(ValidationAttribute), true)] public class ValidationDrawer : BasePropertyDrawer { protected override void PopulateContainer(ElementsContainer container) diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindComponentHandler.cs b/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindHandler.cs similarity index 97% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindComponentHandler.cs rename to Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindHandler.cs index 26e1107..b0dc034 100644 --- a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindComponentHandler.cs +++ b/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindHandler.cs @@ -7,7 +7,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Validation.Handlers { [Serializable] - public class FindComponentHandler : PropertyValidationHandler + public class FindHandler : PropertyValidationHandler { private FindAttribute _findAttribute; diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindComponentHandler.cs.meta b/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindComponentHandler.cs.meta rename to Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/ValidationAttributeBinder.cs b/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/ValidationAttributeBinder.cs index 7dbe049..8fb1612 100644 --- a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/ValidationAttributeBinder.cs +++ b/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/ValidationAttributeBinder.cs @@ -18,7 +18,7 @@ protected override BaseHandlersTypeCollection GenerateCollection() { typeof(NotNullAttribute), typeof(NotNullHandler) }, { typeof(PrefabReferenceAttribute), typeof(PrefabHandler) }, { typeof(SceneReferenceAttribute), typeof(SceneReferenceHandler) }, - { typeof(FindAttribute), typeof(FindComponentHandler) }, + { typeof(FindAttribute), typeof(FindHandler) }, { typeof(DataValidationAttribute), typeof(DataValidationHandler) }, { typeof(MaxAttribute), typeof(MaxWrapper) }, { typeof(ClampAttribute), typeof(ClampWrapper) }, From bb38d3d5078b5af8d09cef2625328d13e4538641 Mon Sep 17 00:00:00 2001 From: uurha Date: Mon, 9 Sep 2024 04:14:53 +0200 Subject: [PATCH 3/7] Add Commons and Internal Core as submodules --- .gitmodules | 8 ++++++++ Assets/BetterCommons | 1 + Assets/BetterCommons.meta | 8 ++++++++ Assets/BetterInternalCore | 1 + Assets/BetterInternalCore.meta | 8 ++++++++ Packages/manifest.json | 2 -- Packages/packages-lock.json | 18 +----------------- 7 files changed, 27 insertions(+), 19 deletions(-) create mode 100644 .gitmodules create mode 160000 Assets/BetterCommons create mode 100644 Assets/BetterCommons.meta create mode 160000 Assets/BetterInternalCore create mode 100644 Assets/BetterInternalCore.meta diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8c8bb23 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,8 @@ +[submodule "BetterInternalCore"] + path = Assets/BetterInternalCore + url = git@github.com:techno-dwarf-works/better-internal-core.git + branch = upm +[submodule "BetterCommons"] + path = Assets/BetterCommons + url = git@github.com:techno-dwarf-works/better-commons.git + branch = upm diff --git a/Assets/BetterCommons b/Assets/BetterCommons new file mode 160000 index 0000000..110f80a --- /dev/null +++ b/Assets/BetterCommons @@ -0,0 +1 @@ +Subproject commit 110f80a51ec9d844081f696a8c6da974baf751d1 diff --git a/Assets/BetterCommons.meta b/Assets/BetterCommons.meta new file mode 100644 index 0000000..c482477 --- /dev/null +++ b/Assets/BetterCommons.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6256957afe10b254a8a23e936de1282a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/BetterInternalCore b/Assets/BetterInternalCore new file mode 160000 index 0000000..dd654e2 --- /dev/null +++ b/Assets/BetterInternalCore @@ -0,0 +1 @@ +Subproject commit dd654e230a625f65aa84468bfcc24b6d326521c8 diff --git a/Assets/BetterInternalCore.meta b/Assets/BetterInternalCore.meta new file mode 100644 index 0000000..36d7e67 --- /dev/null +++ b/Assets/BetterInternalCore.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 59b932ca9050bfa45bbedb4897c0efe0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/manifest.json b/Packages/manifest.json index 265b028..a64183a 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,7 +1,5 @@ { "dependencies": { - "com.tdw.better.commons": "0.0.41", - "com.tdw.better.internal.core": "0.0.2", "com.unity.collab-proxy": "2.0.1", "com.unity.feature.development": "1.0.1", "com.unity.ide.rider": "3.0.18", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 68f8cc5..fcc243e 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -1,21 +1,5 @@ { "dependencies": { - "com.tdw.better.commons": { - "version": "0.0.41", - "depth": 0, - "source": "registry", - "dependencies": { - "com.tdw.better.internal.core": "0.0.2" - }, - "url": "https://package.openupm.com" - }, - "com.tdw.better.internal.core": { - "version": "0.0.2", - "depth": 0, - "source": "registry", - "dependencies": {}, - "url": "https://package.openupm.com" - }, "com.unity.collab-proxy": { "version": "2.0.1", "depth": 0, @@ -125,9 +109,9 @@ "depth": 0, "source": "registry", "dependencies": { + "com.unity.modules.audio": "1.0.0", "com.unity.modules.director": "1.0.0", "com.unity.modules.animation": "1.0.0", - "com.unity.modules.audio": "1.0.0", "com.unity.modules.particlesystem": "1.0.0" }, "url": "https://packages.unity.com" From be83db70a38625c010b58d8f7e1a512016d56afb Mon Sep 17 00:00:00 2001 From: uurha Date: Mon, 9 Sep 2024 04:15:05 +0200 Subject: [PATCH 4/7] Update package.json --- Assets/BetterAttributes/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/BetterAttributes/package.json b/Assets/BetterAttributes/package.json index 128e364..b12b363 100644 --- a/Assets/BetterAttributes/package.json +++ b/Assets/BetterAttributes/package.json @@ -5,7 +5,7 @@ "unity": "2021.3", "description": "Unity attributes, allows to serialize interfaces, draw handles for Vector3/Vector2/Quaternion/Bounds, create read only fields.", "dependencies": { - "com.tdw.better.commons" : "0.0.41", + "com.tdw.better.commons" : "0.0.56", "com.tdw.better.internal.core" : "0.0.2" }, "author": { From e40b61acba4d6016802c0cfe1ec3602e3dea675b Mon Sep 17 00:00:00 2001 From: uurha Date: Mon, 9 Sep 2024 04:17:57 +0200 Subject: [PATCH 5/7] Add detailed attribute and update EditorButtons --- .../Editor/{EditorAddons => }/Comparers.meta | 0 .../Comparers/AnyTypeComparer.cs | 0 .../Comparers/AnyTypeComparer.cs.meta | 0 .../{EditorAddons => }/CustomEditors.meta | 0 .../Editor/CustomEditors/ButtonsEditor.cs | 47 +++++++ .../CustomEditors/ButtonsEditor.cs.meta | 0 .../CustomEditors/GizmosEditor.cs | 0 .../CustomEditors/GizmosEditor.cs.meta | 0 .../Editor/{EditorAddons => }/Drawers.meta | 0 .../Drawers/Decorators.meta | 0 .../Drawers/Decorators/IconHeaderDrawer.cs | 0 .../Decorators/IconHeaderDrawer.cs.meta | 0 .../Drawers/Decorators/PrefabHeaderDrawer.cs | 0 .../Decorators/PrefabHeaderDrawer.cs.meta | 0 .../Decorators/ReferencesHeaderDrawer.cs | 0 .../Decorators/ReferencesHeaderDrawer.cs.meta | 0 .../Decorators/SettingsHeaderDrawer.cs | 0 .../Decorators/SettingsHeaderDrawer.cs.meta | 0 .../Drawers/Decorators/StateHeaderDrawer.cs | 0 .../Decorators/StateHeaderDrawer.cs.meta | 0 .../Drawers/DrawInspector.meta | 0 .../DrawInspector/DrawInspectorDrawer.cs | 0 .../DrawInspector/DrawInspectorDrawer.cs.meta | 0 .../DrawInspector/DrawInspectorHandler.cs | 0 .../DrawInspectorHandler.cs.meta | 0 .../{EditorAddons => }/Drawers/Gizmo.meta | 0 .../Drawers/Gizmo/BaseHandlers.meta | 0 .../Gizmo/BaseHandlers/BoundsBaseHandler.cs | 0 .../BaseHandlers/BoundsBaseHandler.cs.meta | 0 .../Gizmo/BaseHandlers/GizmoHandler.cs | 0 .../Gizmo/BaseHandlers/GizmoHandler.cs.meta | 0 .../Drawers/Gizmo/GizmoDrawer.cs | 0 .../Drawers/Gizmo/GizmoDrawer.cs.meta | 0 .../Drawers/Gizmo/GizmoElementBehaviour.cs | 0 .../Gizmo/GizmoElementBehaviour.cs.meta | 0 .../Drawers/Gizmo/HideTransformDrawer.cs | 0 .../Drawers/Gizmo/HideTransformDrawer.cs.meta | 0 .../Drawers/Gizmo/LocalHandlers.meta | 0 .../Gizmo/LocalHandlers/BoundsLocalHandler.cs | 0 .../LocalHandlers/BoundsLocalHandler.cs.meta | 0 .../LocalHandlers/QuaternionLocalHandler.cs | 0 .../QuaternionLocalHandler.cs.meta | 0 .../LocalHandlers/Vector2LocalHandler.cs | 0 .../LocalHandlers/Vector2LocalHandler.cs.meta | 0 .../LocalHandlers/Vector3LocalHandler.cs | 0 .../LocalHandlers/Vector3LocalHandler.cs.meta | 0 .../Drawers/Gizmo/WorldHandlers.meta | 0 .../Gizmo/WorldHandlers/BoundsHandler.cs | 0 .../Gizmo/WorldHandlers/BoundsHandler.cs.meta | 0 .../Gizmo/WorldHandlers/QuaternionHandler.cs | 0 .../WorldHandlers/QuaternionHandler.cs.meta | 0 .../Gizmo/WorldHandlers/Vector2Handler.cs | 0 .../WorldHandlers/Vector2Handler.cs.meta | 0 .../Gizmo/WorldHandlers/Vector3Handler.cs | 0 .../WorldHandlers/Vector3Handler.cs.meta | 0 .../Drawers/HandlerMaps.meta | 0 .../DrawInspectorTypeHandlerBinder.cs | 0 .../DrawInspectorTypeHandlerBinder.cs.meta | 0 .../HandlerMaps/GizmoTypeHandlerBinder.cs | 0 .../GizmoTypeHandlerBinder.cs.meta | 0 .../ManipulateTypeHandlerBinder.cs | 0 .../ManipulateTypeHandlerBinder.cs.meta | 0 .../Drawers/HandlerMaps/MiscBinder.cs | 6 + .../Drawers/HandlerMaps/MiscBinder.cs.meta | 0 .../HandlerMaps/PreviewTypeHandlerBinder.cs | 0 .../PreviewTypeHandlerBinder.cs.meta | 0 .../HandlerMaps/SelectTypeHandlerBinder.cs | 0 .../SelectTypeHandlerBinder.cs.meta | 0 .../Drawers/Manipulation.meta | 0 .../Drawers/Manipulation/Handlers.meta | 0 .../Handlers/InEditorModeHandler.cs | 0 .../Handlers/InEditorModeHandler.cs.meta | 0 .../Handlers/InPlayModeHandler.cs | 0 .../Handlers/InPlayModeHandler.cs.meta | 0 .../Handlers/ManipulateHandler.cs | 0 .../Handlers/ManipulateHandler.cs.meta | 0 .../ManipulateUserConditionHandler.cs | 2 +- .../ManipulateUserConditionHandler.cs.meta | 0 .../Handlers/ReadOnlyFieldAttributeHandler.cs | 0 .../ReadOnlyFieldAttributeHandler.cs.meta | 0 .../Drawers/Manipulation/ManipulateDrawer.cs | 0 .../Manipulation/ManipulateDrawer.cs.meta | 0 .../{EditorAddons => }/Drawers/Misc.meta | 0 .../Drawers/Misc/Handlers.meta | 0 .../Misc/Handlers/CustomToolTipHandler.cs | 0 .../Handlers/CustomToolTipHandler.cs.meta | 0 .../Drawers/Misc/Handlers/DetailedHandler.cs | 118 ++++++++++++++++++ .../Misc/Handlers/DetailedHandler.cs.meta | 3 + .../Misc/Handlers/EnumButtonsHandler.cs | 0 .../Misc/Handlers/EnumButtonsHandler.cs.meta | 0 .../Drawers/Misc/Handlers/HelpBoxHandler.cs | 2 +- .../Misc/Handlers/HelpBoxHandler.cs.meta | 0 .../Drawers/Misc/Handlers/HideLabelHandler.cs | 0 .../Misc/Handlers/HideLabelHandler.cs.meta | 0 .../Drawers/Misc/Handlers/MiscHandler.cs | 0 .../Drawers/Misc/Handlers/MiscHandler.cs.meta | 0 .../Drawers/Misc/Handlers/MiscLabelHandler.cs | 0 .../Misc/Handlers/MiscLabelHandler.cs.meta | 0 .../Misc/Handlers/RenameFieldHandler.cs | 0 .../Misc/Handlers/RenameFieldHandler.cs.meta | 0 .../Drawers/Misc/MiscDrawer.cs | 0 .../Drawers/Misc/MiscDrawer.cs.meta | 0 .../{EditorAddons => }/Drawers/Preview.meta | 0 .../Drawers/Preview/Handlers.meta | 0 .../Drawers/Preview/Handlers/AssetHandler.cs | 0 .../Preview/Handlers/AssetHandler.cs.meta | 0 .../Preview/Handlers/PreviewHandler.cs | 0 .../Preview/Handlers/PreviewHandler.cs.meta | 0 .../Drawers/Preview/Handlers/SpriteHandler.cs | 0 .../Preview/Handlers/SpriteHandler.cs.meta | 0 .../Preview/Handlers/TextureHandler.cs | 0 .../Preview/Handlers/TextureHandler.cs.meta | 0 .../Drawers/Preview/PreviewDrawer.cs | 0 .../Drawers/Preview/PreviewDrawer.cs.meta | 0 .../Drawers/Preview/PreviewSceneRenderer.cs | 0 .../Preview/PreviewSceneRenderer.cs.meta | 0 .../{EditorAddons => }/Drawers/Select.meta | 0 .../Drawers/Select/Handlers.meta | 0 .../Select/Handlers/BaseSelectHandler.cs | 2 +- .../Select/Handlers/BaseSelectHandler.cs.meta | 0 .../Select/Handlers/BaseSelectTypeHandler.cs | 0 .../Handlers/BaseSelectTypeHandler.cs.meta | 0 .../Select/Handlers/DropdownCollection.meta | 0 .../DictionaryCollection.cs | 0 .../DictionaryCollection.cs.meta | 0 .../EnumerableCollection.cs | 0 .../EnumerableCollection.cs.meta | 0 .../DropdownCollection/IDataCollection.cs | 0 .../IDataCollection.cs.meta | 0 .../DropdownCollection/KeyTupleComparer.cs | 0 .../KeyTupleComparer.cs.meta | 0 .../DropdownCollection/NoneCollection.cs | 0 .../DropdownCollection/NoneCollection.cs.meta | 0 .../Select/Handlers/DropdownHandler.cs | 0 .../Select/Handlers/DropdownHandler.cs.meta | 0 .../Select/Handlers/SelectEnumHandler.cs | 0 .../Select/Handlers/SelectEnumHandler.cs.meta | 0 .../Handlers/SelectImplementationHandler.cs | 0 .../SelectImplementationHandler.cs.meta | 0 .../Handlers/SelectSerializedTypeHandler.cs | 0 .../SelectSerializedTypeHandler.cs.meta | 0 .../Drawers/Select/SelectDrawer.cs | 0 .../Drawers/Select/SelectDrawer.cs.meta | 0 .../Drawers/Select/SelectElementBehaviour.cs | 0 .../Select/SelectElementBehaviour.cs.meta | 0 .../Drawers/Validation.meta | 0 .../Drawers/Validation/Drawers.meta | 0 .../Validation/Drawers/ValidationDrawer.cs | 0 .../Drawers/ValidationDrawer.cs.meta | 0 .../Drawers/Validation/Extensions.meta | 0 .../Extensions/ValidationExtensions.cs | 0 .../Extensions/ValidationExtensions.cs.meta | 0 .../Extensions/ValidationWrapperExtensions.cs | 0 .../ValidationWrapperExtensions.cs.meta | 0 .../Drawers/Validation/Handlers.meta | 0 .../Validation/Handlers/ClampWrapper.cs | 0 .../Validation/Handlers/ClampWrapper.cs.meta | 0 .../Handlers/DataValidationHandler.cs | 2 +- .../Handlers/DataValidationHandler.cs.meta | 0 .../Validation/Handlers/FindHandler.cs | 0 .../Validation/Handlers/FindHandler.cs.meta | 0 .../Drawers/Validation/Handlers/MaxWrapper.cs | 0 .../Validation/Handlers/MaxWrapper.cs.meta | 0 .../Handlers/MissingComponentHandler.cs | 0 .../Handlers/MissingComponentHandler.cs.meta | 0 .../Handlers/MissingReferenceHandler.cs | 0 .../Handlers/MissingReferenceHandler.cs.meta | 0 .../Validation/Handlers/NotNullHandler.cs | 0 .../Handlers/NotNullHandler.cs.meta | 0 .../Validation/Handlers/PrefabHandler.cs | 0 .../Validation/Handlers/PrefabHandler.cs.meta | 0 .../Handlers/PropertyValidationHandler.cs | 0 .../PropertyValidationHandler.cs.meta | 0 .../Handlers/SceneReferenceHandler.cs | 0 .../Handlers/SceneReferenceHandler.cs.meta | 0 .../Validation/Handlers/ValidationHandler.cs | 0 .../Handlers/ValidationHandler.cs.meta | 0 .../Validation/Handlers/ValidationValue.cs | 0 .../Handlers/ValidationValue.cs.meta | 0 .../Validation/ValidationAttributeBinder.cs | 0 .../ValidationAttributeBinder.cs.meta | 0 .../BetterAttributes/Editor/EditorAddons.meta | 3 - .../Editor/{EditorAddons => }/Extensions.meta | 0 .../Extensions/AttributesDefinitions.cs | 0 .../Extensions/AttributesDefinitions.cs.meta | 0 .../Extensions/EnumSetterExtension.cs | 0 .../Extensions/EnumSetterExtension.cs.meta | 0 .../TextureImporterMenuExtensions.cs | 0 .../TextureImporterMenuExtensions.cs.meta | 0 Assets/BetterAttributes/Editor/Helpers.meta | 3 + .../EditorButtonContainer.cs} | 99 +++++++-------- .../Helpers/EditorButtonContainer.cs.meta | 3 + .../Attributes/Misc/DetailedAttribute.cs | 18 +++ .../Attributes/Misc/DetailedAttribute.cs.meta | 3 + .../Attributes/Validation/Clamp01Attribute.cs | 15 +++ .../Validation/Clamp01Attribute.cs.meta | 3 + 196 files changed, 266 insertions(+), 63 deletions(-) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Comparers.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Comparers/AnyTypeComparer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Comparers/AnyTypeComparer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/CustomEditors.meta (100%) create mode 100644 Assets/BetterAttributes/Editor/CustomEditors/ButtonsEditor.cs rename Assets/BetterAttributes/Editor/{EditorAddons => }/CustomEditors/ButtonsEditor.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/CustomEditors/GizmosEditor.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/CustomEditors/GizmosEditor.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Decorators.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Decorators/IconHeaderDrawer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Decorators/IconHeaderDrawer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Decorators/PrefabHeaderDrawer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Decorators/PrefabHeaderDrawer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Decorators/ReferencesHeaderDrawer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Decorators/ReferencesHeaderDrawer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Decorators/SettingsHeaderDrawer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Decorators/SettingsHeaderDrawer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Decorators/StateHeaderDrawer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Decorators/StateHeaderDrawer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/DrawInspector.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/DrawInspector/DrawInspectorDrawer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/DrawInspector/DrawInspectorDrawer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/DrawInspector/DrawInspectorHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/DrawInspector/DrawInspectorHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/BaseHandlers.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/GizmoDrawer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/GizmoDrawer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/GizmoElementBehaviour.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/GizmoElementBehaviour.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/HideTransformDrawer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/HideTransformDrawer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/LocalHandlers.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/WorldHandlers.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/HandlerMaps.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/HandlerMaps/MiscBinder.cs (89%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/HandlerMaps/MiscBinder.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation/Handlers.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation/Handlers/InEditorModeHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation/Handlers/InEditorModeHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation/Handlers/InPlayModeHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation/Handlers/InPlayModeHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation/Handlers/ManipulateHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation/Handlers/ManipulateHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs (96%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation/ManipulateDrawer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Manipulation/ManipulateDrawer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/CustomToolTipHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/CustomToolTipHandler.cs.meta (100%) create mode 100644 Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/DetailedHandler.cs create mode 100644 Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/DetailedHandler.cs.meta rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/EnumButtonsHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/EnumButtonsHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/HelpBoxHandler.cs (96%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/HelpBoxHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/HideLabelHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/HideLabelHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/MiscHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/MiscHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/MiscLabelHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/MiscLabelHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/RenameFieldHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/Handlers/RenameFieldHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/MiscDrawer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Misc/MiscDrawer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview/Handlers.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview/Handlers/AssetHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview/Handlers/AssetHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview/Handlers/PreviewHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview/Handlers/PreviewHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview/Handlers/SpriteHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview/Handlers/SpriteHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview/Handlers/TextureHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview/Handlers/TextureHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview/PreviewDrawer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview/PreviewDrawer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview/PreviewSceneRenderer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Preview/PreviewSceneRenderer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/BaseSelectHandler.cs (99%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/BaseSelectHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/BaseSelectTypeHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/BaseSelectTypeHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/DropdownCollection.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/DropdownCollection/IDataCollection.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/DropdownCollection/IDataCollection.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/DropdownCollection/KeyTupleComparer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/DropdownCollection/KeyTupleComparer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/DropdownCollection/NoneCollection.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/DropdownCollection/NoneCollection.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/DropdownHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/DropdownHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/SelectEnumHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/SelectEnumHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/SelectImplementationHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/SelectImplementationHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/SelectDrawer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/SelectDrawer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/SelectElementBehaviour.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Select/SelectElementBehaviour.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Drawers.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Drawers/ValidationDrawer.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Drawers/ValidationDrawer.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Extensions.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Extensions/ValidationExtensions.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Extensions/ValidationExtensions.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Extensions/ValidationWrapperExtensions.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Extensions/ValidationWrapperExtensions.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/ClampWrapper.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/ClampWrapper.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/DataValidationHandler.cs (97%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/DataValidationHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/FindHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/FindHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/MaxWrapper.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/MaxWrapper.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/MissingComponentHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/MissingComponentHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/MissingReferenceHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/MissingReferenceHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/NotNullHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/NotNullHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/PrefabHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/PrefabHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/PropertyValidationHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/PropertyValidationHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/SceneReferenceHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/SceneReferenceHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/ValidationHandler.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/ValidationHandler.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/ValidationValue.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/Handlers/ValidationValue.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/ValidationAttributeBinder.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Drawers/Validation/ValidationAttributeBinder.cs.meta (100%) delete mode 100644 Assets/BetterAttributes/Editor/EditorAddons.meta rename Assets/BetterAttributes/Editor/{EditorAddons => }/Extensions.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Extensions/AttributesDefinitions.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Extensions/AttributesDefinitions.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Extensions/EnumSetterExtension.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Extensions/EnumSetterExtension.cs.meta (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Extensions/TextureImporterMenuExtensions.cs (100%) rename Assets/BetterAttributes/Editor/{EditorAddons => }/Extensions/TextureImporterMenuExtensions.cs.meta (100%) create mode 100644 Assets/BetterAttributes/Editor/Helpers.meta rename Assets/BetterAttributes/Editor/{EditorAddons/CustomEditors/ButtonsEditor.cs => Helpers/EditorButtonContainer.cs} (52%) create mode 100644 Assets/BetterAttributes/Editor/Helpers/EditorButtonContainer.cs.meta create mode 100644 Assets/BetterAttributes/Runtime/Attributes/Misc/DetailedAttribute.cs create mode 100644 Assets/BetterAttributes/Runtime/Attributes/Misc/DetailedAttribute.cs.meta create mode 100644 Assets/BetterAttributes/Runtime/Attributes/Validation/Clamp01Attribute.cs create mode 100644 Assets/BetterAttributes/Runtime/Attributes/Validation/Clamp01Attribute.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Comparers.meta b/Assets/BetterAttributes/Editor/Comparers.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Comparers.meta rename to Assets/BetterAttributes/Editor/Comparers.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Comparers/AnyTypeComparer.cs b/Assets/BetterAttributes/Editor/Comparers/AnyTypeComparer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Comparers/AnyTypeComparer.cs rename to Assets/BetterAttributes/Editor/Comparers/AnyTypeComparer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Comparers/AnyTypeComparer.cs.meta b/Assets/BetterAttributes/Editor/Comparers/AnyTypeComparer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Comparers/AnyTypeComparer.cs.meta rename to Assets/BetterAttributes/Editor/Comparers/AnyTypeComparer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/CustomEditors.meta b/Assets/BetterAttributes/Editor/CustomEditors.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/CustomEditors.meta rename to Assets/BetterAttributes/Editor/CustomEditors.meta diff --git a/Assets/BetterAttributes/Editor/CustomEditors/ButtonsEditor.cs b/Assets/BetterAttributes/Editor/CustomEditors/ButtonsEditor.cs new file mode 100644 index 0000000..6166576 --- /dev/null +++ b/Assets/BetterAttributes/Editor/CustomEditors/ButtonsEditor.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; +using System.Reflection; +using Better.Attributes.EditorAddons.Helpers; +using Better.Attributes.Runtime; +using Better.Commons.EditorAddons.CustomEditors.Attributes; +using Better.Commons.EditorAddons.CustomEditors.Base; +using Better.Commons.EditorAddons.Extensions; +using UnityEditor; +using UnityEngine; +using UnityEngine.UIElements; +using Object = UnityEngine.Object; + +namespace Better.Attributes.EditorAddons.CustomEditors +{ + [MultiEditor(typeof(Object), true, Order = 999)] + public class ButtonsEditor : ExtendedEditor + { + private Dictionary>> _methodButtonsAttributes = + new Dictionary>>(); + + public ButtonsEditor(Object target, SerializedObject serializedObject) : base(target, serializedObject) + { + } + + public override void OnDisable() + { + } + + public override void OnEnable() + { + var type = _target.GetType(); + _methodButtonsAttributes = EditorButtonUtility.GetSortedMethodAttributes(type); + } + + + public override VisualElement CreateInspectorGUI() + { + var container = new EditorButtonContainer(_serializedObject); + container.CreateFromTarget(_target); + return container; + } + + public override void OnChanged(SerializedObject serializedObject) + { + } + } +} \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/EditorAddons/CustomEditors/ButtonsEditor.cs.meta b/Assets/BetterAttributes/Editor/CustomEditors/ButtonsEditor.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/CustomEditors/ButtonsEditor.cs.meta rename to Assets/BetterAttributes/Editor/CustomEditors/ButtonsEditor.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/CustomEditors/GizmosEditor.cs b/Assets/BetterAttributes/Editor/CustomEditors/GizmosEditor.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/CustomEditors/GizmosEditor.cs rename to Assets/BetterAttributes/Editor/CustomEditors/GizmosEditor.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/CustomEditors/GizmosEditor.cs.meta b/Assets/BetterAttributes/Editor/CustomEditors/GizmosEditor.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/CustomEditors/GizmosEditor.cs.meta rename to Assets/BetterAttributes/Editor/CustomEditors/GizmosEditor.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers.meta b/Assets/BetterAttributes/Editor/Drawers.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers.meta rename to Assets/BetterAttributes/Editor/Drawers.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators.meta b/Assets/BetterAttributes/Editor/Drawers/Decorators.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators.meta rename to Assets/BetterAttributes/Editor/Drawers/Decorators.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/IconHeaderDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Decorators/IconHeaderDrawer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/IconHeaderDrawer.cs rename to Assets/BetterAttributes/Editor/Drawers/Decorators/IconHeaderDrawer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/IconHeaderDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Decorators/IconHeaderDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/IconHeaderDrawer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Decorators/IconHeaderDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Decorators/PrefabHeaderDrawer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs rename to Assets/BetterAttributes/Editor/Drawers/Decorators/PrefabHeaderDrawer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Decorators/PrefabHeaderDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Decorators/PrefabHeaderDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Decorators/ReferencesHeaderDrawer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs rename to Assets/BetterAttributes/Editor/Drawers/Decorators/ReferencesHeaderDrawer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Decorators/ReferencesHeaderDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Decorators/ReferencesHeaderDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Decorators/SettingsHeaderDrawer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs rename to Assets/BetterAttributes/Editor/Drawers/Decorators/SettingsHeaderDrawer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Decorators/SettingsHeaderDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Decorators/SettingsHeaderDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Decorators/StateHeaderDrawer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs rename to Assets/BetterAttributes/Editor/Drawers/Decorators/StateHeaderDrawer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Decorators/StateHeaderDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Decorators/StateHeaderDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/DrawInspector.meta b/Assets/BetterAttributes/Editor/Drawers/DrawInspector.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/DrawInspector.meta rename to Assets/BetterAttributes/Editor/Drawers/DrawInspector.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/DrawInspector/DrawInspectorDrawer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs rename to Assets/BetterAttributes/Editor/Drawers/DrawInspector/DrawInspectorDrawer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/DrawInspector/DrawInspectorDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/DrawInspector/DrawInspectorDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorHandler.cs b/Assets/BetterAttributes/Editor/Drawers/DrawInspector/DrawInspectorHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/DrawInspector/DrawInspectorHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/DrawInspector/DrawInspectorHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/DrawInspector/DrawInspectorHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/GizmoDrawer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/GizmoDrawer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/GizmoDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/GizmoDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/GizmoElementBehaviour.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/GizmoElementBehaviour.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/GizmoElementBehaviour.cs rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/GizmoElementBehaviour.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/GizmoElementBehaviour.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/GizmoElementBehaviour.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/GizmoElementBehaviour.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/GizmoElementBehaviour.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/HideTransformDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/HideTransformDrawer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/HideTransformDrawer.cs rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/HideTransformDrawer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/HideTransformDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/HideTransformDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/HideTransformDrawer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/HideTransformDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps.meta b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps.meta rename to Assets/BetterAttributes/Editor/Drawers/HandlerMaps.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs rename to Assets/BetterAttributes/Editor/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs.meta b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs rename to Assets/BetterAttributes/Editor/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs.meta b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs rename to Assets/BetterAttributes/Editor/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs.meta b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/MiscBinder.cs b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps/MiscBinder.cs similarity index 89% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/MiscBinder.cs rename to Assets/BetterAttributes/Editor/Drawers/HandlerMaps/MiscBinder.cs index 4e53c94..997b31a 100644 --- a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/MiscBinder.cs +++ b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps/MiscBinder.cs @@ -46,6 +46,12 @@ protected override BaseHandlersTypeCollection GenerateCollection() { typeof(Type), typeof(RenameFieldHandler) } } }, + { + typeof(DetailedAttribute), new Dictionary(AnyTypeComparer.Instance) + { + { typeof(Type), typeof(DetailedHandler) } + } + }, }; } diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/MiscBinder.cs.meta b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps/MiscBinder.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/MiscBinder.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/HandlerMaps/MiscBinder.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs rename to Assets/BetterAttributes/Editor/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs.meta b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs rename to Assets/BetterAttributes/Editor/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs.meta b/Assets/BetterAttributes/Editor/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation.meta b/Assets/BetterAttributes/Editor/Drawers/Manipulation.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation.meta rename to Assets/BetterAttributes/Editor/Drawers/Manipulation.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers.meta b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers.meta rename to Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/InEditorModeHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/InEditorModeHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/InEditorModeHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/InEditorModeHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/InEditorModeHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/InEditorModeHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/InEditorModeHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/InEditorModeHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/InPlayModeHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/InPlayModeHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/InPlayModeHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/InPlayModeHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/InPlayModeHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/InPlayModeHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/InPlayModeHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/InPlayModeHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/ManipulateHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ManipulateHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/ManipulateHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ManipulateHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/ManipulateHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ManipulateHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/ManipulateHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ManipulateHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs similarity index 96% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs index c26c442..117c8bd 100644 --- a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs @@ -49,7 +49,7 @@ public override void SetProperty(SerializedProperty property, ManipulateAttribut { base.SetProperty(property, attribute); _userAttribute = (ManipulateUserConditionAttribute)attribute; - _container = _property.GetLastNonCollectionContainer(); + _container = _property.GetLastNonCollectionParent(); } } } \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/ManipulateDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Manipulation/ManipulateDrawer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/ManipulateDrawer.cs rename to Assets/BetterAttributes/Editor/Drawers/Manipulation/ManipulateDrawer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/ManipulateDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Manipulation/ManipulateDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Manipulation/ManipulateDrawer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Manipulation/ManipulateDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc.meta b/Assets/BetterAttributes/Editor/Drawers/Misc.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc.meta rename to Assets/BetterAttributes/Editor/Drawers/Misc.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers.meta b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers.meta rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/CustomToolTipHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/CustomToolTipHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/CustomToolTipHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/CustomToolTipHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/CustomToolTipHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/CustomToolTipHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/CustomToolTipHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/CustomToolTipHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/DetailedHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/DetailedHandler.cs new file mode 100644 index 0000000..22868af --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/DetailedHandler.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using Better.Attributes.EditorAddons.CustomEditors; +using Better.Attributes.EditorAddons.Helpers; +using Better.Attributes.Runtime.Misc; +using Better.Commons.EditorAddons.Drawers.Container; +using Better.Commons.EditorAddons.Extensions; +using Better.Commons.EditorAddons.Helpers; +using Better.Commons.EditorAddons.Utility; +using Better.Commons.Runtime.Extensions; +using Better.Commons.Runtime.Utility; +using Better.Internal.Core.Runtime; +using UnityEditor; +using UnityEngine; + +namespace Better.Attributes.EditorAddons.Drawers.Misc +{ + //TODO: add parameters + public class DetailedHandler : MiscHandler + { + private DetailedAttribute _detailedAttribute; + private EditorButtonContainer _buttonContainer; + + protected override void OnSetupContainer() + { + _detailedAttribute = (DetailedAttribute)_attribute; + + if (!ValidateNested()) + { + return; + } + + var target = GetValueFromContainer(_container); + + _buttonContainer = new EditorButtonContainer(_container.SerializedObject); + _container.CreateElementFrom(_buttonContainer); + + if (target != null) + { + _buttonContainer.CreateFromTarget(target); + } + + _container.SerializedPropertyChanged += OnPropertyChanged; + } + + private bool ValidateNested() + { + if (!_detailedAttribute.Nested) + { + return true; + } + + var serializedProperty = _container.SerializedProperty; + var list = new List(); + serializedProperty.CollectPropertyParents(ref list); + + for (var i = list.Count - 1; i >= 0; i--) + { + var valueTuple = list[i]; + var container = valueTuple.ParentInstance; + var fieldName = valueTuple.FieldName; + + if (fieldName.IsNullOrEmpty() || container.GetType().IsEnumerable()) + { + continue; + } + + var field = container.GetType().GetField(fieldName, Defines.FieldsFlags); + + if (field == null || field.GetCustomAttributes(typeof(DetailedAttribute), true).Length <= 0) + { + return false; + } + + if (container is MonoBehaviour or ScriptableObject) + { + return true; + } + } + + return false; + } + + private object GetValueFromContainer(ElementsContainer elementsContainer) + { + var property = elementsContainer.SerializedProperty; + switch (property.propertyType) + { + case SerializedPropertyType.Generic: + return property.GetValue(); + case SerializedPropertyType.ManagedReference: + return property.managedReferenceValue; + default: + return null; + } + } + + private void OnPropertyChanged(ElementsContainer container) + { + var target = GetValueFromContainer(_container); + + if (target == null) + { + _buttonContainer.Clear(); + return; + } + + _buttonContainer.CreateFromTarget(target); + } + + public override void Deconstruct() + { + _container.SerializedPropertyChanged -= OnPropertyChanged; + } + } +} \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/DetailedHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/DetailedHandler.cs.meta new file mode 100644 index 0000000..67aadbf --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/DetailedHandler.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9d5d7dfb57b34cd6be00a1ff786947c9 +timeCreated: 1725358184 \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/EnumButtonsHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/EnumButtonsHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/EnumButtonsHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/EnumButtonsHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/EnumButtonsHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/EnumButtonsHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/EnumButtonsHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/EnumButtonsHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/HelpBoxHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/HelpBoxHandler.cs similarity index 96% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/HelpBoxHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/HelpBoxHandler.cs index 0c71d97..aa60415 100644 --- a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/HelpBoxHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/HelpBoxHandler.cs @@ -14,7 +14,7 @@ protected override void OnSetupContainer() var textOrSelector = helpBoxAttribute.Text; - var instance = _container.SerializedProperty.GetLastNonCollectionContainer(); + var instance = _container.SerializedProperty.GetLastNonCollectionParent(); if (SelectorUtility.TryGetValue(textOrSelector, instance, out var value)) { diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/HelpBoxHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/HelpBoxHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/HelpBoxHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/HelpBoxHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/HideLabelHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/HideLabelHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/HideLabelHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/HideLabelHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/HideLabelHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/HideLabelHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/HideLabelHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/HideLabelHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/MiscHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/MiscHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/MiscHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/MiscHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/MiscHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/MiscHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/MiscHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/MiscHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/MiscLabelHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/MiscLabelHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/MiscLabelHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/MiscLabelHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/MiscLabelHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/MiscLabelHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/MiscLabelHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/MiscLabelHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/RenameFieldHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/RenameFieldHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/RenameFieldHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/RenameFieldHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/RenameFieldHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/RenameFieldHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/Handlers/RenameFieldHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/RenameFieldHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/MiscDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Misc/MiscDrawer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/MiscDrawer.cs rename to Assets/BetterAttributes/Editor/Drawers/Misc/MiscDrawer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/MiscDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Misc/MiscDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Misc/MiscDrawer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Misc/MiscDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview.meta b/Assets/BetterAttributes/Editor/Drawers/Preview.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview.meta rename to Assets/BetterAttributes/Editor/Drawers/Preview.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers.meta b/Assets/BetterAttributes/Editor/Drawers/Preview/Handlers.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers.meta rename to Assets/BetterAttributes/Editor/Drawers/Preview/Handlers.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/AssetHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/AssetHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/AssetHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/AssetHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/AssetHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/AssetHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/AssetHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/AssetHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/PreviewHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/PreviewHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/PreviewHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/PreviewHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/PreviewHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/PreviewHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/PreviewHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/PreviewHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/SpriteHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/SpriteHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/SpriteHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/SpriteHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/SpriteHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/SpriteHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/SpriteHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/SpriteHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/TextureHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/TextureHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/TextureHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/TextureHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/TextureHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/TextureHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/Handlers/TextureHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Preview/Handlers/TextureHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Preview/PreviewDrawer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs rename to Assets/BetterAttributes/Editor/Drawers/Preview/PreviewDrawer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Preview/PreviewDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Preview/PreviewDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/PreviewSceneRenderer.cs b/Assets/BetterAttributes/Editor/Drawers/Preview/PreviewSceneRenderer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/PreviewSceneRenderer.cs rename to Assets/BetterAttributes/Editor/Drawers/Preview/PreviewSceneRenderer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/PreviewSceneRenderer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Preview/PreviewSceneRenderer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Preview/PreviewSceneRenderer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Preview/PreviewSceneRenderer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select.meta b/Assets/BetterAttributes/Editor/Drawers/Select.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select.meta rename to Assets/BetterAttributes/Editor/Drawers/Select.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers.meta b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/BaseSelectHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectHandler.cs similarity index 99% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/BaseSelectHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectHandler.cs index 8694e3c..ad8a1ff 100644 --- a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/BaseSelectHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectHandler.cs @@ -32,7 +32,7 @@ public void Setup(ElementsContainer container, FieldInfo fieldInfo, BaseSelectAt Container = container; FieldInfo = fieldInfo; Attribute = attribute; - PropertyContainer = Container.SerializedProperty.GetLastNonCollectionContainer(); + PropertyContainer = Container.SerializedProperty.GetLastNonCollectionParent(); CurrentValue = GetCurrentValue(); OnSetup(); } diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/BaseSelectHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/BaseSelectHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/BaseSelectTypeHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectTypeHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/BaseSelectTypeHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectTypeHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/BaseSelectTypeHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectTypeHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/BaseSelectTypeHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectTypeHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection.meta b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/IDataCollection.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/IDataCollection.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/IDataCollection.cs rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/IDataCollection.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/IDataCollection.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/IDataCollection.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/IDataCollection.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/IDataCollection.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/KeyTupleComparer.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/KeyTupleComparer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/KeyTupleComparer.cs rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/KeyTupleComparer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/KeyTupleComparer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/KeyTupleComparer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/KeyTupleComparer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/KeyTupleComparer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/NoneCollection.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/NoneCollection.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/NoneCollection.cs rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/NoneCollection.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/NoneCollection.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/NoneCollection.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/NoneCollection.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/NoneCollection.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/DropdownHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectEnumHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectEnumHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectEnumHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectEnumHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectEnumHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectEnumHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectEnumHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectEnumHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectImplementationHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectImplementationHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectImplementationHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectImplementationHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectImplementationHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectImplementationHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectImplementationHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectImplementationHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/SelectDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Select/SelectDrawer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/SelectDrawer.cs rename to Assets/BetterAttributes/Editor/Drawers/Select/SelectDrawer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/SelectDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Select/SelectDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/SelectDrawer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/SelectDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/SelectElementBehaviour.cs b/Assets/BetterAttributes/Editor/Drawers/Select/SelectElementBehaviour.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/SelectElementBehaviour.cs rename to Assets/BetterAttributes/Editor/Drawers/Select/SelectElementBehaviour.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/SelectElementBehaviour.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Select/SelectElementBehaviour.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Select/SelectElementBehaviour.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Select/SelectElementBehaviour.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation.meta b/Assets/BetterAttributes/Editor/Drawers/Validation.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Drawers.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Drawers.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Drawers.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Drawers.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Drawers/ValidationDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Drawers/ValidationDrawer.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Drawers/ValidationDrawer.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Drawers/ValidationDrawer.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Drawers/ValidationDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Drawers/ValidationDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Drawers/ValidationDrawer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Drawers/ValidationDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Extensions.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Extensions.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Extensions.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Extensions.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Extensions/ValidationExtensions.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Extensions/ValidationExtensions.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Extensions/ValidationExtensions.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Extensions/ValidationExtensions.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Extensions/ValidationExtensions.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Extensions/ValidationExtensions.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Extensions/ValidationExtensions.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Extensions/ValidationExtensions.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Extensions/ValidationWrapperExtensions.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Extensions/ValidationWrapperExtensions.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Extensions/ValidationWrapperExtensions.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Extensions/ValidationWrapperExtensions.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Extensions/ValidationWrapperExtensions.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Extensions/ValidationWrapperExtensions.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Extensions/ValidationWrapperExtensions.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Extensions/ValidationWrapperExtensions.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/ClampWrapper.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/ClampWrapper.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/ClampWrapper.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/ClampWrapper.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/ClampWrapper.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/ClampWrapper.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/ClampWrapper.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/ClampWrapper.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/DataValidationHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/DataValidationHandler.cs similarity index 97% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/DataValidationHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/DataValidationHandler.cs index 375e614..f38073b 100644 --- a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/DataValidationHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/DataValidationHandler.cs @@ -16,7 +16,7 @@ public override ValidationValue Validate() var fieldCache = Property.GetFieldInfoAndStaticTypeFromProperty(); var att = (DataValidationAttribute)Attribute; - var propertyContainer = Property.GetPropertyContainer(); + var propertyContainer = Property.GetPropertyParent(); var method = propertyContainer.GetType().GetMethod(att.MethodName, Defines.MethodFlags); var methodName = $"\"{att.MethodName.FormatBoldItalic()}\""; if (method == null) diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/DataValidationHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/DataValidationHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/DataValidationHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/DataValidationHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/FindHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/FindHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/FindHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/FindHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/FindHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/MaxWrapper.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/MaxWrapper.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/MaxWrapper.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/MaxWrapper.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/MaxWrapper.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/MaxWrapper.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/MaxWrapper.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/MaxWrapper.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/MissingComponentHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/MissingComponentHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/MissingComponentHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/MissingComponentHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/MissingComponentHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/MissingComponentHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/MissingComponentHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/MissingComponentHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/MissingReferenceHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/MissingReferenceHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/MissingReferenceHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/MissingReferenceHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/MissingReferenceHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/MissingReferenceHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/MissingReferenceHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/MissingReferenceHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/NotNullHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/NotNullHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/NotNullHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/NotNullHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/NotNullHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/NotNullHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/NotNullHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/NotNullHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/PrefabHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/PrefabHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/PrefabHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/PrefabHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/PrefabHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/PrefabHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/PrefabHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/PrefabHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/PropertyValidationHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/PropertyValidationHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/PropertyValidationHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/PropertyValidationHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/PropertyValidationHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/PropertyValidationHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/PropertyValidationHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/PropertyValidationHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/SceneReferenceHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/SceneReferenceHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/SceneReferenceHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/SceneReferenceHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/SceneReferenceHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/SceneReferenceHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/SceneReferenceHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/SceneReferenceHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/ValidationHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/ValidationHandler.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/ValidationHandler.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/ValidationHandler.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/ValidationHandler.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/ValidationHandler.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/ValidationHandler.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/ValidationHandler.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/ValidationValue.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/ValidationValue.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/ValidationValue.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/ValidationValue.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/ValidationValue.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/ValidationValue.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/Handlers/ValidationValue.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/Handlers/ValidationValue.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/ValidationAttributeBinder.cs b/Assets/BetterAttributes/Editor/Drawers/Validation/ValidationAttributeBinder.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/ValidationAttributeBinder.cs rename to Assets/BetterAttributes/Editor/Drawers/Validation/ValidationAttributeBinder.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/ValidationAttributeBinder.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Validation/ValidationAttributeBinder.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Drawers/Validation/ValidationAttributeBinder.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/Validation/ValidationAttributeBinder.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons.meta b/Assets/BetterAttributes/Editor/EditorAddons.meta deleted file mode 100644 index e535a52..0000000 --- a/Assets/BetterAttributes/Editor/EditorAddons.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 2723479bb55b0c147952fbbce94104cb -timeCreated: 1660519157 \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Extensions.meta b/Assets/BetterAttributes/Editor/Extensions.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Extensions.meta rename to Assets/BetterAttributes/Editor/Extensions.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Extensions/AttributesDefinitions.cs b/Assets/BetterAttributes/Editor/Extensions/AttributesDefinitions.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Extensions/AttributesDefinitions.cs rename to Assets/BetterAttributes/Editor/Extensions/AttributesDefinitions.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Extensions/AttributesDefinitions.cs.meta b/Assets/BetterAttributes/Editor/Extensions/AttributesDefinitions.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Extensions/AttributesDefinitions.cs.meta rename to Assets/BetterAttributes/Editor/Extensions/AttributesDefinitions.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Extensions/EnumSetterExtension.cs b/Assets/BetterAttributes/Editor/Extensions/EnumSetterExtension.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Extensions/EnumSetterExtension.cs rename to Assets/BetterAttributes/Editor/Extensions/EnumSetterExtension.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Extensions/EnumSetterExtension.cs.meta b/Assets/BetterAttributes/Editor/Extensions/EnumSetterExtension.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Extensions/EnumSetterExtension.cs.meta rename to Assets/BetterAttributes/Editor/Extensions/EnumSetterExtension.cs.meta diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Extensions/TextureImporterMenuExtensions.cs b/Assets/BetterAttributes/Editor/Extensions/TextureImporterMenuExtensions.cs similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Extensions/TextureImporterMenuExtensions.cs rename to Assets/BetterAttributes/Editor/Extensions/TextureImporterMenuExtensions.cs diff --git a/Assets/BetterAttributes/Editor/EditorAddons/Extensions/TextureImporterMenuExtensions.cs.meta b/Assets/BetterAttributes/Editor/Extensions/TextureImporterMenuExtensions.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/EditorAddons/Extensions/TextureImporterMenuExtensions.cs.meta rename to Assets/BetterAttributes/Editor/Extensions/TextureImporterMenuExtensions.cs.meta diff --git a/Assets/BetterAttributes/Editor/Helpers.meta b/Assets/BetterAttributes/Editor/Helpers.meta new file mode 100644 index 0000000..174a87b --- /dev/null +++ b/Assets/BetterAttributes/Editor/Helpers.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 265b1c57ccc14c62aafeda9bf9db75e3 +timeCreated: 1725848161 \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/EditorAddons/CustomEditors/ButtonsEditor.cs b/Assets/BetterAttributes/Editor/Helpers/EditorButtonContainer.cs similarity index 52% rename from Assets/BetterAttributes/Editor/EditorAddons/CustomEditors/ButtonsEditor.cs rename to Assets/BetterAttributes/Editor/Helpers/EditorButtonContainer.cs index 2bebc90..f1981ea 100644 --- a/Assets/BetterAttributes/Editor/EditorAddons/CustomEditors/ButtonsEditor.cs +++ b/Assets/BetterAttributes/Editor/Helpers/EditorButtonContainer.cs @@ -1,81 +1,60 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Reflection; using Better.Attributes.Runtime; -using Better.Commons.EditorAddons.CustomEditors.Attributes; -using Better.Commons.EditorAddons.CustomEditors.Base; -using Better.Commons.EditorAddons.Extensions; using Better.Commons.EditorAddons.Utility; using Better.Commons.Runtime.Extensions; +using Better.Commons.Runtime.Utility; using UnityEditor; -using UnityEngine; using UnityEngine.UIElements; -using Object = UnityEngine.Object; -namespace Better.Attributes.EditorAddons.CustomEditors +namespace Better.Attributes.EditorAddons.Helpers { - [MultiEditor(typeof(Object), true, Order = 999)] - public class ButtonsEditor : ExtendedEditor + public class EditorButtonContainer : VisualElement { - private Dictionary>> _methodButtonsAttributes = - new Dictionary>>(); + private readonly SerializedObject _serializedObject; + private Dictionary>> _buttons; + private object _target; - public ButtonsEditor(Object target, SerializedObject serializedObject) : base(target, serializedObject) + public EditorButtonContainer(SerializedObject serializedObject) { + _serializedObject = serializedObject; } - public override void OnDisable() + public void CreateFromTarget(object target) { - } - - public override void OnEnable() - { - var type = _target.GetType(); - _methodButtonsAttributes = EditorButtonUtility.GetSortedMethodAttributes(type); - } - - private Button DrawButton(MethodInfo methodInfo, EditorButtonAttribute attribute) - { - var button = new Button + if (target == null) { - text = attribute.GetDisplayName(methodInfo.PrettyMemberName()), - name = methodInfo.PrettyMemberName() - }; - button.style.FlexGrow(StyleDefinition.OneStyleFloat); - button.RegisterCallback(OnClick, (methodInfo, attribute)); - return button; - } + DebugUtility.LogException(nameof(target)); + return; + } - private void OnClick(ClickEvent clickEvent, (MethodInfo methodInfo, EditorButtonAttribute attribute) data) - { - _serializedObject.Update(); - data.methodInfo.Invoke(_target, data.attribute.InvokeParams); - EditorUtility.SetDirty(_target); - _serializedObject.ApplyModifiedProperties(); + _target = target; + Clear(); + var type = _target.GetType(); + Add(type); } - - private VisualElement DrawButtons(Dictionary>> buttons) + private void Add(Type targetType) { - var container = new VisualElement(); - - foreach (var button in buttons) + var methodAttributes = EditorButtonUtility.GetSortedMethodAttributes(targetType); + foreach (var (priority, keyValuePairs) in methodAttributes) { - if (button.Key == -1) + if (priority == -1) { - var grouped = button.Value.GroupBy(key => key.Key, pair => pair.Value, - (info, attributes) => new KeyValuePair>(info, attributes)); + var grouped = keyValuePairs.GroupBy(key => key.Key, pair => pair.Value, (methodInfo, attributes) => (methodInfo, attributes)); var verticalElement = VisualElementUtility.CreateVerticalGroup(); - container.Add(verticalElement); + Add(verticalElement); foreach (var group in grouped) { var horizontalElement = VisualElementUtility.CreateHorizontalGroup(); verticalElement.Add(horizontalElement); - foreach (var attribute in group.Value) + foreach (var attribute in group.attributes) { - var buttonElement = DrawButton(group.Key, attribute); + var buttonElement = DrawButton(group.methodInfo, attribute); horizontalElement.Add(buttonElement); } } @@ -83,26 +62,34 @@ private VisualElement DrawButtons(Dictionary(OnClick, (methodInfo, attribute)); + return button; } - public override void OnChanged(SerializedObject serializedObject) + private void OnClick(ClickEvent clickEvent, (MethodInfo methodInfo, EditorButtonAttribute attribute) data) { + _serializedObject.Update(); + data.methodInfo.Invoke(_target, data.attribute.InvokeParams); + EditorUtility.SetDirty(_serializedObject.targetObject); + _serializedObject.ApplyModifiedProperties(); } } } \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Helpers/EditorButtonContainer.cs.meta b/Assets/BetterAttributes/Editor/Helpers/EditorButtonContainer.cs.meta new file mode 100644 index 0000000..1bc5b37 --- /dev/null +++ b/Assets/BetterAttributes/Editor/Helpers/EditorButtonContainer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 176e86a484d24f3e9ecdd19cec2d7b62 +timeCreated: 1725671015 \ No newline at end of file diff --git a/Assets/BetterAttributes/Runtime/Attributes/Misc/DetailedAttribute.cs b/Assets/BetterAttributes/Runtime/Attributes/Misc/DetailedAttribute.cs new file mode 100644 index 0000000..f91ca62 --- /dev/null +++ b/Assets/BetterAttributes/Runtime/Attributes/Misc/DetailedAttribute.cs @@ -0,0 +1,18 @@ +using System; +using System.Diagnostics; +using Better.Internal.Core.Runtime; + +namespace Better.Attributes.Runtime.Misc +{ + [Conditional(Defines.Editor)] + [AttributeUsage(AttributeTargets.Field)] + public class DetailedAttribute : MiscAttribute + { + public bool Nested { get; set; } + + public DetailedAttribute() + { + Nested = true; + } + } +} \ No newline at end of file diff --git a/Assets/BetterAttributes/Runtime/Attributes/Misc/DetailedAttribute.cs.meta b/Assets/BetterAttributes/Runtime/Attributes/Misc/DetailedAttribute.cs.meta new file mode 100644 index 0000000..edab90f --- /dev/null +++ b/Assets/BetterAttributes/Runtime/Attributes/Misc/DetailedAttribute.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: fc302d4867384ac2aff12bfc9226da32 +timeCreated: 1725357956 \ No newline at end of file diff --git a/Assets/BetterAttributes/Runtime/Attributes/Validation/Clamp01Attribute.cs b/Assets/BetterAttributes/Runtime/Attributes/Validation/Clamp01Attribute.cs new file mode 100644 index 0000000..dddccf6 --- /dev/null +++ b/Assets/BetterAttributes/Runtime/Attributes/Validation/Clamp01Attribute.cs @@ -0,0 +1,15 @@ +using System; +using System.Diagnostics; +using Better.Internal.Core.Runtime; + +namespace Better.Attributes.Runtime.Validation +{ + [Conditional(Defines.Editor)] + [AttributeUsage(AttributeTargets.Field)] + public class Clamp01Attribute : ClampAttribute + { + public Clamp01Attribute() : base(0f, 1f) + { + } + } +} \ No newline at end of file diff --git a/Assets/BetterAttributes/Runtime/Attributes/Validation/Clamp01Attribute.cs.meta b/Assets/BetterAttributes/Runtime/Attributes/Validation/Clamp01Attribute.cs.meta new file mode 100644 index 0000000..507682d --- /dev/null +++ b/Assets/BetterAttributes/Runtime/Attributes/Validation/Clamp01Attribute.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4b130eef04b2435eac1faacb66b2df23 +timeCreated: 1725760346 \ No newline at end of file From 621df32b31c6e2aecdcd17515c8df458a847cd21 Mon Sep 17 00:00:00 2001 From: uurha Date: Mon, 7 Oct 2024 01:10:52 +0200 Subject: [PATCH 6/7] Fixes for dropdown, select, and add button parameters --- .../Editor/CustomEditors/ButtonsEditor.cs | 15 +- .../Editor/Drawers/EditorButton.meta | 3 + .../EditorButton/EditorButtonDrawer.cs | 172 ++++++++++++++++++ .../EditorButton/EditorButtonDrawer.cs.meta} | 0 .../Gizmo/BaseHandlers/GizmoHandler.cs | 43 +---- .../Editor/Drawers/Gizmo/GizmoDrawer.cs | 31 +--- .../ManipulateUserConditionHandler.cs | 21 +-- .../Drawers/Manipulation/ManipulateDrawer.cs | 6 + .../Misc/Handlers/CustomToolTipHandler.cs | 1 + .../Drawers/Misc/Handlers/DetailedHandler.cs | 14 +- .../Drawers/Misc/Handlers/HelpBoxHandler.cs | 2 +- .../{Helpers.meta => Drawers/Parameters.meta} | 0 .../Editor/Drawers/Parameters/FieldFactory.cs | 17 ++ .../Drawers/Parameters/FieldFactory.cs.meta | 3 + .../Parameters/FieldFactoryExtensions.cs | 15 ++ .../Parameters/FieldFactoryExtensions.cs.meta | 3 + .../Editor/Drawers/Parameters/Parameter.cs | 25 +++ .../Drawers/Parameters/Parameter.cs.meta | 3 + .../Parameters/ParameterFieldProvider.cs | 172 ++++++++++++++++++ .../Parameters/ParameterFieldProvider.cs.meta | 3 + .../Parameters/ParametersElementDrawer.cs | 31 ++++ .../ParametersElementDrawer.cs.meta | 3 + .../Select/Handlers/BaseSelectHandler.cs | 4 +- .../Select/Handlers/BaseSelectTypeHandler.cs | 1 + .../DictionaryCollection.cs | 1 + .../EnumerableCollection.cs | 1 + .../Select/Handlers/DropdownHandler.cs | 4 +- .../Select/Handlers/SelectEnumHandler.cs | 1 + .../Handlers/SelectSerializedTypeHandler.cs | 1 + .../Editor/Drawers/Select/SelectDrawer.cs | 16 +- .../Editor/Helpers/EditorButtonContainer.cs | 95 ---------- Assets/BetterAttributes/Editor/Utilities.meta | 3 + .../Utilities}/EditorButtonUtility.cs | 21 ++- .../Utilities}/EditorButtonUtility.cs.meta | 0 .../Attributes/EditorButtonAttribute.cs | 15 +- .../Attributes/Misc/HelpBoxAttribute.cs | 6 +- .../BetterAttributes/Runtime/Collections.meta | 3 + .../Runtime/Collections/DropdownCollection.cs | 19 ++ .../Collections/DropdownCollection.cs.meta | 3 + .../BetterAttributes/Runtime/Utilities.meta | 3 + .../Runtime/{ => Utilities}/LabelDefines.cs | 2 +- .../{ => Utilities}/LabelDefines.cs.meta | 0 .../Samples~/TestSamples/Scenes/Sample.unity | 105 +++++++++-- .../TestSamples/Scripts/AbstractTester.meta | 3 + .../Scripts/AbstractTester/AbstractTest.cs | 18 ++ .../AbstractTester/AbstractTest.cs.meta | 3 + .../Scripts/AbstractTester/AbstractTester.cs | 11 ++ .../AbstractTester/AbstractTester.cs.meta | 3 + .../Scripts/AbstractTester/ShowTest.cs | 9 + .../Scripts/AbstractTester/ShowTest.cs.meta | 3 + .../TestSamples/Scripts/ButtonTester.meta | 3 + .../Scripts/ButtonTester/ButtonTester.cs | 44 +++++ .../Scripts/ButtonTester/ButtonTester.cs.meta | 3 + .../TestSamples/Scripts/DropdownTester.meta | 3 + .../Scripts/DropdownTester/DropdownTester.cs | 99 ++++++++++ .../DropdownTester/DropdownTester.cs.meta | 3 + .../Scripts/ITestSerializableType.cs | 6 + .../Scripts/ITestSerializableType.cs.meta | 3 + .../SomeAbstractClassImplementation1.cs | 1 + .../SomeAbstractClassImplementation2.cs | 24 +++ .../TestSamples/Scripts/MyFlagEnum.cs | 12 ++ .../TestSamples/Scripts/MyFlagEnum.cs.meta | 3 + .../TestSamples/Scripts/SingletonTest.cs | 6 + .../Samples~/TestSamples/Scripts/Test.cs | 86 ++------- .../Samples~/TestSamples/Scripts/TestEnum.cs | 34 ++++ .../TestSamples/Scripts/TestEnum.cs.meta | 3 + .../Samples~/TestSamples/Scripts/TestInner.cs | 13 ++ .../TestSamples/Scripts/TestInner.cs.meta | 3 + .../Scripts/TestScriptableObject.cs | 4 +- .../Scripts/TestSerializableType.cs | 22 +++ .../Scripts/TestSerializableType.cs.meta | 3 + Assets/BetterCommons | 2 +- 72 files changed, 999 insertions(+), 318 deletions(-) create mode 100644 Assets/BetterAttributes/Editor/Drawers/EditorButton.meta create mode 100644 Assets/BetterAttributes/Editor/Drawers/EditorButton/EditorButtonDrawer.cs rename Assets/BetterAttributes/Editor/{Helpers/EditorButtonContainer.cs.meta => Drawers/EditorButton/EditorButtonDrawer.cs.meta} (100%) rename Assets/BetterAttributes/Editor/{Helpers.meta => Drawers/Parameters.meta} (100%) create mode 100644 Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactory.cs create mode 100644 Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactory.cs.meta create mode 100644 Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactoryExtensions.cs create mode 100644 Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactoryExtensions.cs.meta create mode 100644 Assets/BetterAttributes/Editor/Drawers/Parameters/Parameter.cs create mode 100644 Assets/BetterAttributes/Editor/Drawers/Parameters/Parameter.cs.meta create mode 100644 Assets/BetterAttributes/Editor/Drawers/Parameters/ParameterFieldProvider.cs create mode 100644 Assets/BetterAttributes/Editor/Drawers/Parameters/ParameterFieldProvider.cs.meta create mode 100644 Assets/BetterAttributes/Editor/Drawers/Parameters/ParametersElementDrawer.cs create mode 100644 Assets/BetterAttributes/Editor/Drawers/Parameters/ParametersElementDrawer.cs.meta delete mode 100644 Assets/BetterAttributes/Editor/Helpers/EditorButtonContainer.cs create mode 100644 Assets/BetterAttributes/Editor/Utilities.meta rename Assets/BetterAttributes/{Runtime => Editor/Utilities}/EditorButtonUtility.cs (70%) rename Assets/BetterAttributes/{Runtime => Editor/Utilities}/EditorButtonUtility.cs.meta (100%) create mode 100644 Assets/BetterAttributes/Runtime/Collections.meta create mode 100644 Assets/BetterAttributes/Runtime/Collections/DropdownCollection.cs create mode 100644 Assets/BetterAttributes/Runtime/Collections/DropdownCollection.cs.meta create mode 100644 Assets/BetterAttributes/Runtime/Utilities.meta rename Assets/BetterAttributes/Runtime/{ => Utilities}/LabelDefines.cs (87%) rename Assets/BetterAttributes/Runtime/{ => Utilities}/LabelDefines.cs.meta (100%) create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/AbstractTester.meta create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/AbstractTester/AbstractTest.cs create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/AbstractTester/AbstractTest.cs.meta create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/AbstractTester/AbstractTester.cs create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/AbstractTester/AbstractTester.cs.meta create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/AbstractTester/ShowTest.cs create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/AbstractTester/ShowTest.cs.meta create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/ButtonTester.meta create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/ButtonTester/ButtonTester.cs create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/ButtonTester/ButtonTester.cs.meta create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/DropdownTester.meta create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/DropdownTester/DropdownTester.cs create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/DropdownTester/DropdownTester.cs.meta create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/ITestSerializableType.cs create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/ITestSerializableType.cs.meta create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/MyFlagEnum.cs create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/MyFlagEnum.cs.meta create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/TestEnum.cs create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/TestEnum.cs.meta create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/TestInner.cs create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/TestInner.cs.meta create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/TestSerializableType.cs create mode 100644 Assets/BetterAttributes/Samples~/TestSamples/Scripts/TestSerializableType.cs.meta diff --git a/Assets/BetterAttributes/Editor/CustomEditors/ButtonsEditor.cs b/Assets/BetterAttributes/Editor/CustomEditors/ButtonsEditor.cs index 6166576..c227eba 100644 --- a/Assets/BetterAttributes/Editor/CustomEditors/ButtonsEditor.cs +++ b/Assets/BetterAttributes/Editor/CustomEditors/ButtonsEditor.cs @@ -1,12 +1,7 @@ -using System.Collections.Generic; -using System.Reflection; -using Better.Attributes.EditorAddons.Helpers; -using Better.Attributes.Runtime; +using Better.Attributes.EditorAddons.Drawers.EditorButton; using Better.Commons.EditorAddons.CustomEditors.Attributes; using Better.Commons.EditorAddons.CustomEditors.Base; -using Better.Commons.EditorAddons.Extensions; using UnityEditor; -using UnityEngine; using UnityEngine.UIElements; using Object = UnityEngine.Object; @@ -15,9 +10,6 @@ namespace Better.Attributes.EditorAddons.CustomEditors [MultiEditor(typeof(Object), true, Order = 999)] public class ButtonsEditor : ExtendedEditor { - private Dictionary>> _methodButtonsAttributes = - new Dictionary>>(); - public ButtonsEditor(Object target, SerializedObject serializedObject) : base(target, serializedObject) { } @@ -28,14 +20,11 @@ public override void OnDisable() public override void OnEnable() { - var type = _target.GetType(); - _methodButtonsAttributes = EditorButtonUtility.GetSortedMethodAttributes(type); } - public override VisualElement CreateInspectorGUI() { - var container = new EditorButtonContainer(_serializedObject); + var container = new EditorButtonDrawer(_serializedObject); container.CreateFromTarget(_target); return container; } diff --git a/Assets/BetterAttributes/Editor/Drawers/EditorButton.meta b/Assets/BetterAttributes/Editor/Drawers/EditorButton.meta new file mode 100644 index 0000000..da034b8 --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/EditorButton.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0d9eaab591d5423dbfb40e8059a86f61 +timeCreated: 1728247401 \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Drawers/EditorButton/EditorButtonDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/EditorButton/EditorButtonDrawer.cs new file mode 100644 index 0000000..4297424 --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/EditorButton/EditorButtonDrawer.cs @@ -0,0 +1,172 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Better.Attributes.EditorAddons.Drawers.Parameters; +using Better.Attributes.EditorAddons.Utilities; +using Better.Attributes.Runtime; +using Better.Commons.EditorAddons.Enums; +using Better.Commons.EditorAddons.Extensions; +using Better.Commons.EditorAddons.Utility; +using Better.Commons.Runtime.Extensions; +using Better.Commons.Runtime.UIElements; +using Better.Commons.Runtime.Utility; +using UnityEditor; +using UnityEngine.UIElements; + +namespace Better.Attributes.EditorAddons.Drawers.EditorButton +{ + public class EditorButtonDrawer : VisualElement + { + private readonly SerializedObject _serializedObject; + private Dictionary>> _buttons; + private object _target; + + public EditorButtonDrawer(SerializedObject serializedObject) + { + _serializedObject = serializedObject; + } + + public void CreateFromTarget(object target) + { + if (target == null) + { + DebugUtility.LogException(nameof(target)); + return; + } + + _target = target; + Clear(); + var type = _target.GetType(); + Add(type); + } + + private void Add(Type targetType) + { + var methodAttributes = EditorButtonUtility.GetSortedMethodAttributes(targetType); + foreach (var (captureGroup, keyValuePairs) in methodAttributes) + { + if (captureGroup == -1) + { + var grouped = keyValuePairs.GroupBy(key => key.Key, pair => pair.Value, (methodInfo, attributes) => (methodInfo, attributes)); + var verticalElement = VisualElementUtility.CreateVerticalGroup(); + Add(verticalElement); + + foreach (var group in grouped) + { + var horizontalElement = VisualElementUtility.CreateHorizontalGroup(); + verticalElement.Add(horizontalElement); + + foreach (var attribute in group.attributes) + { + var visualElement = CreateFromMethodInfo(group.methodInfo, attribute); + horizontalElement.Add(visualElement); + } + } + } + else + { + var horizontalElement = VisualElementUtility.CreateHorizontalGroup(); + Add(horizontalElement); + foreach (var (key, value) in keyValuePairs) + { + var visualElement = CreateFromMethodInfo(key, value); + horizontalElement.Add(visualElement); + } + } + } + } + + private VisualElement CreateFromMethodInfo(MethodInfo methodInfo, EditorButtonAttribute attribute) + { + var parameters = methodInfo.GetParameters(); + foreach (var parameterInfo in parameters) + { + if (!ParameterFieldProvider.IsSupported(parameterInfo.ParameterType) || parameterInfo.IsOut) + { + return CreateNotSupportedHelpBox(methodInfo, parameterInfo); + } + } + + return CreateButton(methodInfo, attribute); + } + + private static HelpBox CreateNotSupportedHelpBox(MethodInfo methodInfo, ParameterInfo parameterInfo) + { + string message; + if (parameterInfo.IsOut) + { + message = $"Parameter({parameterInfo.Name}) with \"out\" modificator in {methodInfo.Name} not supported"; + } + else + { + message = $"Parameter({parameterInfo.Name}) with type {parameterInfo.ParameterType} in {methodInfo.Name} not supported"; + } + + var helpBox = VisualElementUtility.HelpBox(message, HelpBoxMessageType.Error); + helpBox.style.FlexGrow(StyleDefinition.OneStyleFloat); + return helpBox; + } + + private VisualElement CreateButton(MethodInfo methodInfo, EditorButtonAttribute attribute) + { + var prettyMemberName = methodInfo.PrettyMemberName(); + + var verticalGroup = VisualElementUtility.CreateVerticalGroup(); + verticalGroup.name = $"{prettyMemberName}__{nameof(verticalGroup)}"; + verticalGroup.style + .FlexGrow(StyleDefinition.OneStyleFloat) + .FlexBasis(0.5f); + + var horizontalGroup = VisualElementUtility.CreateHorizontalGroup(); + horizontalGroup.name = $"{prettyMemberName}__{nameof(horizontalGroup)}"; + horizontalGroup.style + .FlexGrow(StyleDefinition.OneStyleFloat) + .MaxHeight(StyleDefinition.ButtonHeight); + + verticalGroup.Add(horizontalGroup); + + var button = new Button + { + text = attribute.GetDisplayName(prettyMemberName), + name = prettyMemberName + }; + + var parameters = methodInfo.GetParameters(); + var datas = parameters.Select(info => new Parameter(info)).ToArray(); + + var parametersElement = new ParametersElementDrawer(datas); + verticalGroup.Add(parametersElement); + + if (!datas.IsNullOrEmpty()) + { + var toggle = new ToggleButton(value => parametersElement.style.SetVisible(value)); + toggle.AddIcon(IconType.GrayDropdown); + toggle.style.Padding(1f); + + toggle.text = string.Empty; + horizontalGroup.Add(toggle); + } + else + { + parametersElement.style.SetVisible(false); + } + + horizontalGroup.Add(button); + button.style.FlexGrow(StyleDefinition.OneStyleFloat); + button.RegisterCallback(OnClick, methodInfo, parametersElement); + return verticalGroup; + } + + private void OnClick(ClickEvent clickEvent, (MethodInfo methodInfo, ParametersElementDrawer parameters) data) + { + _serializedObject.Update(); + var parameters = data.parameters; + + //TODO: Validate parameters count and types + data.methodInfo.Invoke(_target, parameters.GetData()); + EditorUtility.SetDirty(_serializedObject.targetObject); + _serializedObject.ApplyModifiedProperties(); + } + } +} \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Helpers/EditorButtonContainer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/EditorButton/EditorButtonDrawer.cs.meta similarity index 100% rename from Assets/BetterAttributes/Editor/Helpers/EditorButtonContainer.cs.meta rename to Assets/BetterAttributes/Editor/Drawers/EditorButton/EditorButtonDrawer.cs.meta diff --git a/Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs index d758855..0546e26 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs @@ -29,17 +29,12 @@ public virtual void SetProperty(SerializedProperty property, Type fieldType) private string GetCompiledName() { - if (Validate()) + if (_serializedProperty.IsArrayElement()) { - if (_serializedProperty.IsArrayElement()) - { - return $"{ObjectNames.NicifyVariableName(_serializedProperty.GetArrayPath())}"; - } - - return _serializedProperty.displayName; + return $"{ObjectNames.NicifyVariableName(_serializedProperty.GetArrayPath())}"; } - return string.Empty; + return _serializedProperty.displayName; } public void SetMode(bool value) @@ -59,40 +54,8 @@ public override void Deconstruct() _serializedProperty = null; } - public virtual bool Validate() - { - try - { - if (_serializedProperty == null) - { - return false; - } - - if (!_serializedProperty.Verify()) - { - return false; - } - - if (_serializedProperty.IsDisposed()) - { - return false; - } - - return _serializedProperty.serializedObject.targetObject != null; - } - catch - { - return false; - } - } - private protected void SetValueAndApply(object value) { - if (!Validate()) - { - return; - } - if (_fieldType.IsEquivalentTo(typeof(Vector2))) _serializedProperty.vector2Value = (Vector2)value; else if (_fieldType.IsEquivalentTo(typeof(Vector3))) diff --git a/Assets/BetterAttributes/Editor/Drawers/Gizmo/GizmoDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Gizmo/GizmoDrawer.cs index cf13697..6d6afb1 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Gizmo/GizmoDrawer.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Gizmo/GizmoDrawer.cs @@ -36,44 +36,25 @@ private void OnSceneGUIDelegate(SceneView sceneView) { if (sceneView.drawGizmos) { - ValidationUtility.ValidateCachedProperties(Handlers); + Handlers?.Revalidate(); Apply(sceneView); } } private void Apply(SceneView sceneView) { - List keysToRemove = null; + Handlers.Revalidate(); + foreach (var gizmo in Handlers) { var valueWrapper = gizmo.Value.Handler; - if (valueWrapper.Validate()) - { - valueWrapper.Apply(sceneView); - } - else - { - if (keysToRemove == null) - { - keysToRemove = new List(); - } - - keysToRemove.Add(gizmo.Key); - } - } - - if (keysToRemove != null) - { - foreach (var property in keysToRemove) - { - Handlers.Remove(property); - } + valueWrapper.Apply(sceneView); } } - protected override void Deconstruct() + protected override void ContainerReleased(ElementsContainer container) { - base.Deconstruct(); + base.ContainerReleased(container); SceneView.duringSceneGui -= OnSceneGUIDelegate; } diff --git a/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs index 117c8bd..23c022f 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs @@ -1,6 +1,8 @@ using System; +using System.Reflection; using Better.Attributes.Runtime.Manipulation; using Better.Commons.EditorAddons.Extensions; +using Better.Commons.Runtime.Extensions; using Better.Internal.Core.Runtime; using UnityEditor; @@ -20,26 +22,23 @@ protected override bool IsConditionSatisfied() { if (_container == null) return false; var type = _container.GetType(); - var field = type.GetField(_userAttribute.MemberName, Defines.FieldsFlags); + var memberInfo = type.GetMemberByNameRecursive(_userAttribute.MemberName); var memberValue = _userAttribute.MemberValue; - if (field != null) + if (memberInfo is FieldInfo fieldInfo) { - var value = field.GetValue(_container); + var value = fieldInfo.GetValue(_container); return Equals(memberValue, value); } - var method = type.GetMethod(_userAttribute.MemberName, Defines.MethodFlags); - if (method != null) + if (memberInfo is MethodInfo methodInfo) { - return Equals(memberValue, method.Invoke(_container, Array.Empty())); + return Equals(memberValue, methodInfo.Invoke(_container, Array.Empty())); } - var property = type.GetProperty(_userAttribute.MemberName, Defines.FieldsFlags); - var propertyValue = _userAttribute.MemberValue; - if (property != null) + if (memberInfo is PropertyInfo propertyInfo) { - var value = property.GetValue(_container); - return Equals(memberValue, propertyValue); + var value = propertyInfo.GetValue(_container); + return Equals(memberValue, value); } return false; diff --git a/Assets/BetterAttributes/Editor/Drawers/Manipulation/ManipulateDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Manipulation/ManipulateDrawer.cs index e2a2a74..6b93afd 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Manipulation/ManipulateDrawer.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Manipulation/ManipulateDrawer.cs @@ -21,5 +21,11 @@ private void SerializedObjectChanged(ElementsContainer container) var wrapper = GetHandler(container.SerializedProperty); wrapper.UpdateState(container); } + + protected override void ContainerReleased(ElementsContainer container) + { + base.ContainerReleased(container); + container.SerializedObjectChanged -= SerializedObjectChanged; + } } } \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/CustomToolTipHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/CustomToolTipHandler.cs index c736e03..bc57663 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/CustomToolTipHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/CustomToolTipHandler.cs @@ -1,5 +1,6 @@ using Better.Attributes.Runtime; using Better.Attributes.Runtime.Misc; +using Better.Attributes.Runtime.Utilities; using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Helpers; diff --git a/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/DetailedHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/DetailedHandler.cs index 22868af..85d814e 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/DetailedHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/DetailedHandler.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Reflection; using Better.Attributes.EditorAddons.CustomEditors; -using Better.Attributes.EditorAddons.Helpers; +using Better.Attributes.EditorAddons.Drawers.EditorButton; using Better.Attributes.Runtime.Misc; using Better.Commons.EditorAddons.Drawers.Container; using Better.Commons.EditorAddons.Extensions; @@ -21,7 +21,7 @@ namespace Better.Attributes.EditorAddons.Drawers.Misc public class DetailedHandler : MiscHandler { private DetailedAttribute _detailedAttribute; - private EditorButtonContainer _buttonContainer; + private EditorButtonDrawer _buttonDrawer; protected override void OnSetupContainer() { @@ -34,12 +34,12 @@ protected override void OnSetupContainer() var target = GetValueFromContainer(_container); - _buttonContainer = new EditorButtonContainer(_container.SerializedObject); - _container.CreateElementFrom(_buttonContainer); + _buttonDrawer = new EditorButtonDrawer(_container.SerializedObject); + _container.CreateElementFrom(_buttonDrawer); if (target != null) { - _buttonContainer.CreateFromTarget(target); + _buttonDrawer.CreateFromTarget(target); } _container.SerializedPropertyChanged += OnPropertyChanged; @@ -103,11 +103,11 @@ private void OnPropertyChanged(ElementsContainer container) if (target == null) { - _buttonContainer.Clear(); + _buttonDrawer.Clear(); return; } - _buttonContainer.CreateFromTarget(target); + _buttonDrawer.CreateFromTarget(target); } public override void Deconstruct() diff --git a/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/HelpBoxHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/HelpBoxHandler.cs index aa60415..70ba329 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/HelpBoxHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Misc/Handlers/HelpBoxHandler.cs @@ -12,7 +12,7 @@ protected override void OnSetupContainer() { var helpBoxAttribute = (HelpBoxAttribute)_attribute; - var textOrSelector = helpBoxAttribute.Text; + var textOrSelector = helpBoxAttribute.TextOrSelector; var instance = _container.SerializedProperty.GetLastNonCollectionParent(); diff --git a/Assets/BetterAttributes/Editor/Helpers.meta b/Assets/BetterAttributes/Editor/Drawers/Parameters.meta similarity index 100% rename from Assets/BetterAttributes/Editor/Helpers.meta rename to Assets/BetterAttributes/Editor/Drawers/Parameters.meta diff --git a/Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactory.cs b/Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactory.cs new file mode 100644 index 0000000..f5c9d15 --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactory.cs @@ -0,0 +1,17 @@ +using System; +using UnityEngine.UIElements; + +namespace Better.Attributes.EditorAddons.Drawers.Parameters +{ + internal class FieldFactory + { + public Func SupportedFunc { get; } + public Func CreateFunc { get; } + + public FieldFactory(Func supportedFunc, Func createFunc) + { + SupportedFunc = supportedFunc; + CreateFunc = createFunc; + } + } +} \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactory.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactory.cs.meta new file mode 100644 index 0000000..4c0361d --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactory.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 76110228d40a4daa9405ac4e6dca5d78 +timeCreated: 1728170017 \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactoryExtensions.cs b/Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactoryExtensions.cs new file mode 100644 index 0000000..4b9b423 --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactoryExtensions.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using UnityEngine.UIElements; + +namespace Better.Attributes.EditorAddons.Drawers.Parameters +{ + internal static class FieldFactoryExtensions + { + public static void Add(this List self, Func supportedFunc, Func createFunc) + { + var fieldFactory = new FieldFactory(supportedFunc, createFunc); + self.Add(fieldFactory); + } + } +} \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactoryExtensions.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactoryExtensions.cs.meta new file mode 100644 index 0000000..8365765 --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/Parameters/FieldFactoryExtensions.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c28b76082e0f44ad97236aa46ff275f5 +timeCreated: 1728170017 \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Drawers/Parameters/Parameter.cs b/Assets/BetterAttributes/Editor/Drawers/Parameters/Parameter.cs new file mode 100644 index 0000000..e8df834 --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/Parameters/Parameter.cs @@ -0,0 +1,25 @@ +using System; +using System.Reflection; +using Better.Commons.Runtime.Extensions; + +namespace Better.Attributes.EditorAddons.Drawers.Parameters +{ + internal class Parameter + { + public Type ParameterType { get; } + public string Name { get; } + public object Data { get; private set; } + + public Parameter(ParameterInfo info) + { + ParameterType = info.ParameterType; + Name = info.Name; + Data = info.HasDefaultValue ? info.DefaultValue : info.ParameterType.GetDefault(); + } + + public void SetData(object newData) + { + Data = newData; + } + } +} \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Drawers/Parameters/Parameter.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Parameters/Parameter.cs.meta new file mode 100644 index 0000000..81a83a2 --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/Parameters/Parameter.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: cf89768481e84de38506f9dace919d85 +timeCreated: 1727930947 \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Drawers/Parameters/ParameterFieldProvider.cs b/Assets/BetterAttributes/Editor/Drawers/Parameters/ParameterFieldProvider.cs new file mode 100644 index 0000000..7871b4b --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/Parameters/ParameterFieldProvider.cs @@ -0,0 +1,172 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Better.Commons.EditorAddons.Utility; +using Better.Commons.Runtime.Extensions; +using UnityEditor; +using UnityEditor.UIElements; +using UnityEngine; +using UnityEngine.UIElements; +using Object = UnityEngine.Object; + +namespace Better.Attributes.EditorAddons.Drawers.Parameters +{ + internal static class ParameterFieldProvider + { + private const string ObjectFieldDisplayClassName = "unity-object-field-display"; + private static List _factories; + + static ParameterFieldProvider() + { + _factories = new List(); + + _factories.Add(SupportDirectType, ConfigureIntegerField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureStringField); + + _factories.Add(SupportDirectType, ConfigureCharField); + + _factories.Add(type => SupportDirectType(type) || SupportDirectType(type), ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(type => type.IsSubclassOf(), ConfigureEnumField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(SupportDirectType, ConfigureField); + + _factories.Add(type => type.IsSubclassOf(), ConfigureObjectField); + } + + private static bool SupportDirectType(Type type) + { + return type == typeof(T); + } + + private static VisualElement ConfigureEnumField(Parameter parameter) + { + var enumType = parameter.ParameterType; + var enumValues = enumType.GetEnumValues().Cast().ToList(); + var enumDisplayNames = enumValues.Select(enumValue => ObjectNames.NicifyVariableName(enumValue.ToString())).ToList(); + var enumValueIndex = enumValues.IndexOf(parameter.Data); + if (enumType.IsDefined(typeof(FlagsAttribute), false)) + { + var enumField = ConfigureField(parameter); + enumField.choices = enumDisplayNames; + enumField.value = (Enum)Enum.ToObject(enumType, enumValueIndex); + return enumField; + } + + + var propertyFieldIndex = enumValueIndex < 0 || enumValueIndex >= enumDisplayNames.Count ? -1 : enumValueIndex; + + var popupField = ConfigureField, string>(parameter); + + popupField.choices = enumDisplayNames; + popupField.index = propertyFieldIndex; + + return popupField; + } + + private static VisualElement ConfigureStringField(Parameter parameter) + { + var textField = ConfigureField(parameter); + textField.maxLength = -1; + return textField; + } + + private static VisualElement ConfigureCharField(Parameter parameter) + { + var textField = ConfigureField(parameter); + textField.maxLength = -1; + return textField; + } + + private static VisualElement ConfigureObjectField(Parameter parameter) + { + var objectField = ConfigureField(parameter); + objectField.objectType = parameter.ParameterType; + objectField.allowSceneObjects = true; + + var visualElement = objectField.Q(ObjectFieldDisplayClassName); + visualElement?.style.Width(StyleDefinition.OneStyleLength); + + return objectField; + } + + private static VisualElement ConfigureIntegerField(Parameter parameter) + { + var integerField = ConfigureField(parameter); + integerField.isDelayed = false; + return integerField; + } + + private static TField ConfigureField( + Parameter parameter) + where TField : BaseField, new() + { + var field = new TField(); + field.RegisterValueChangedCallback(evt => { parameter.SetData(evt.newValue); }); + field.value = (TValue)parameter.Data; + field.label = ObjectNames.NicifyVariableName(parameter.Name); + field.style.FlexGrow(StyleDefinition.OneStyleFloat); + field.labelElement.style.MinWidth(StyleKeyword.Auto); + return field; + } + + public static bool IsSupported(Type type) + { + foreach (var factory in _factories) + { + if (factory.SupportedFunc.Invoke(type)) + { + return true; + } + } + + return false; + } + + public static VisualElement CreateParameterField(Parameter parameter) + { + foreach (var factory in _factories) + { + if (factory.SupportedFunc.Invoke(parameter.ParameterType)) + { + return factory.CreateFunc.Invoke(parameter); + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Drawers/Parameters/ParameterFieldProvider.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Parameters/ParameterFieldProvider.cs.meta new file mode 100644 index 0000000..9ba7501 --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/Parameters/ParameterFieldProvider.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f9426f96b055458db7a5ffa05c121c48 +timeCreated: 1728165033 \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Drawers/Parameters/ParametersElementDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Parameters/ParametersElementDrawer.cs new file mode 100644 index 0000000..70516e8 --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/Parameters/ParametersElementDrawer.cs @@ -0,0 +1,31 @@ +using System.Linq; +using Better.Commons.Runtime.Extensions; +using UnityEngine.UIElements; + +namespace Better.Attributes.EditorAddons.Drawers.Parameters +{ + internal class ParametersElementDrawer : VisualElement + { + private readonly Parameter[] _parameters; + + public ParametersElementDrawer(Parameter[] parameters) + { + _parameters = parameters; + + foreach (var parameter in _parameters) + { + var element = ParameterFieldProvider.CreateParameterField(parameter); + Add(element); + } + + AddToClassList(HelpBox.ussClassName); + style.PaddingRight(5f) + .FlexDirection(FlexDirection.Column); + } + + public object[] GetData() + { + return _parameters.Select(parameter => parameter.Data).ToArray(); + } + } +} \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Drawers/Parameters/ParametersElementDrawer.cs.meta b/Assets/BetterAttributes/Editor/Drawers/Parameters/ParametersElementDrawer.cs.meta new file mode 100644 index 0000000..7497348 --- /dev/null +++ b/Assets/BetterAttributes/Editor/Drawers/Parameters/ParametersElementDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 07792e463aa74c54a5e41505711bd9de +timeCreated: 1727930947 \ No newline at end of file diff --git a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectHandler.cs index ad8a1ff..15cf034 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectHandler.cs @@ -3,6 +3,7 @@ using System.Reflection; using Better.Attributes.Runtime; using Better.Attributes.Runtime.Select; +using Better.Attributes.Runtime.Utilities; using Better.Commons.EditorAddons.Drawers; using Better.Commons.EditorAddons.Drawers.Container; using Better.Commons.EditorAddons.Drawers.Handlers; @@ -144,7 +145,8 @@ public virtual void OnPopulateContainer() if (IsSkippingFieldDraw()) { var label = VisualElementUtility.CreateLabelFor(Container.SerializedProperty); - Container.RootElement.Insert(0, label); + var element = Container.CreateElementFrom(label); + element.SendToBack(); label.style.Width(StyleDefinition.LabelWidthStyle); label.SendToBack(); label.AddToClassList(PropertyField.labelUssClassName); diff --git a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectTypeHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectTypeHandler.cs index 198dc32..353343b 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectTypeHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/BaseSelectTypeHandler.cs @@ -4,6 +4,7 @@ using Better.Attributes.EditorAddons.Extensions; using Better.Attributes.Runtime; using Better.Attributes.Runtime.Select; +using Better.Attributes.Runtime.Utilities; using Better.Commons.EditorAddons.Utility; using Better.Commons.Runtime.Utility; using UnityEngine; diff --git a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs index 7af98fd..85b181b 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using Better.Attributes.Runtime; +using Better.Attributes.Runtime.Utilities; using Better.Commons.Runtime.Extensions; using UnityEngine; diff --git a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs index 62cdd96..20067b3 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Runtime.CompilerServices; using Better.Attributes.Runtime; +using Better.Attributes.Runtime.Utilities; using Better.Commons.Runtime.Extensions; namespace Better.Attributes.EditorAddons.Drawers.Select diff --git a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownHandler.cs index 24e78a4..4255d34 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/DropdownHandler.cs @@ -5,6 +5,7 @@ using Better.Attributes.EditorAddons.Extensions; using Better.Attributes.Runtime; using Better.Attributes.Runtime.Select; +using Better.Attributes.Runtime.Utilities; using Better.Commons.EditorAddons.Extensions; using Better.Commons.EditorAddons.Utility; using Better.Commons.Runtime.Comparers; @@ -62,8 +63,7 @@ protected override List GetObjects() { return _collection.GetValues(); } - - + protected override GUIContent GetResolvedName(object value, DisplayName displayName) { if (value == null) diff --git a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectEnumHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectEnumHandler.cs index abbf933..a3ac679 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectEnumHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectEnumHandler.cs @@ -5,6 +5,7 @@ using Better.Attributes.EditorAddons.Extensions; using Better.Attributes.Runtime; using Better.Attributes.Runtime.Select; +using Better.Attributes.Runtime.Utilities; using Better.Commons.EditorAddons.Extensions; using Better.Commons.Runtime.Extensions; using Better.Commons.Runtime.Utility; diff --git a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs index c18c49c..7ba490c 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs @@ -5,6 +5,7 @@ using Better.Attributes.EditorAddons.Extensions; using Better.Attributes.Runtime; using Better.Attributes.Runtime.Select; +using Better.Attributes.Runtime.Utilities; using Better.Commons.EditorAddons.Extensions; using Better.Commons.EditorAddons.Utility; using Better.Commons.Runtime.DataStructures.SerializedTypes; diff --git a/Assets/BetterAttributes/Editor/Drawers/Select/SelectDrawer.cs b/Assets/BetterAttributes/Editor/Drawers/Select/SelectDrawer.cs index ffb16a7..22f7b5c 100644 --- a/Assets/BetterAttributes/Editor/Drawers/Select/SelectDrawer.cs +++ b/Assets/BetterAttributes/Editor/Drawers/Select/SelectDrawer.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using Better.Attributes.Runtime.Select; using Better.Commons.EditorAddons.Comparers; using Better.Commons.EditorAddons.Drawers; @@ -7,11 +6,9 @@ using Better.Commons.EditorAddons.Drawers.Container; using Better.Commons.EditorAddons.DropDown; using Better.Commons.EditorAddons.Extensions; -using Better.Commons.EditorAddons.Helpers; using Better.Commons.EditorAddons.Utility; using Better.Commons.Runtime.Extensions; using UnityEditor; -using UnityEditor.UIElements; using UnityEngine; using UnityEngine.UIElements; @@ -57,7 +54,10 @@ protected override void PopulateContainer(ElementsContainer container) handler.OnPopulateContainer(); - container.RootElement.OnElementAppear