From 524386b0557c15516782f849b8ef3bbe9d5f9445 Mon Sep 17 00:00:00 2001 From: uurha Date: Mon, 12 Aug 2024 02:14:47 +0000 Subject: [PATCH] Update README.md and LICENSE --- Editor.meta | 8 + Editor/BetterAttributes.Editor.asmdef | 21 + Editor/BetterAttributes.Editor.asmdef.meta | 7 + Editor/EditorAddons.meta | 3 + Editor/EditorAddons/Comparers.meta | 3 + .../EditorAddons/Comparers/AnyTypeComparer.cs | 23 + .../Comparers/AnyTypeComparer.cs.meta | 3 + Editor/EditorAddons/CustomEditors.meta | 3 + .../CustomEditors/ButtonsEditor.cs | 108 ++++ .../CustomEditors/ButtonsEditor.cs.meta | 11 + .../CustomEditors/GizmosEditor.cs | 76 +++ .../CustomEditors/GizmosEditor.cs.meta | 3 + Editor/EditorAddons/Drawers.meta | 8 + Editor/EditorAddons/Drawers/Decorators.meta | 8 + .../Drawers/Decorators/IconHeaderDrawer.cs | 40 ++ .../Decorators/IconHeaderDrawer.cs.meta | 3 + .../Drawers/Decorators/PrefabHeaderDrawer.cs | 22 + .../Decorators/PrefabHeaderDrawer.cs.meta | 3 + .../Decorators/ReferencesHeaderDrawer.cs | 22 + .../Decorators/ReferencesHeaderDrawer.cs.meta | 3 + .../Decorators/SettingsHeaderDrawer.cs | 22 + .../Decorators/SettingsHeaderDrawer.cs.meta | 3 + .../Drawers/Decorators/StateHeaderDrawer.cs | 22 + .../Decorators/StateHeaderDrawer.cs.meta | 3 + .../EditorAddons/Drawers/DrawInspector.meta | 3 + .../DrawInspector/DrawInspectorDrawer.cs | 60 ++ .../DrawInspector/DrawInspectorDrawer.cs.meta | 3 + .../DrawInspector/DrawInspectorHandler.cs | 98 +++ .../DrawInspectorHandler.cs.meta | 3 + Editor/EditorAddons/Drawers/Gizmo.meta | 3 + .../Drawers/Gizmo/BaseHandlers.meta | 3 + .../Gizmo/BaseHandlers/BoundsBaseHandler.cs | 42 ++ .../BaseHandlers/BoundsBaseHandler.cs.meta | 3 + .../Gizmo/BaseHandlers/GizmoHandler.cs | 132 ++++ .../Gizmo/BaseHandlers/GizmoHandler.cs.meta | 3 + .../EditorAddons/Drawers/Gizmo/GizmoDrawer.cs | 128 ++++ .../Drawers/Gizmo/GizmoDrawer.cs.meta | 3 + .../Drawers/Gizmo/GizmoElementBehaviour.cs | 25 + .../Gizmo/GizmoElementBehaviour.cs.meta | 3 + .../Drawers/Gizmo/HideTransformDrawer.cs | 34 ++ .../Drawers/Gizmo/HideTransformDrawer.cs.meta | 3 + .../Drawers/Gizmo/LocalHandlers.meta | 3 + .../Gizmo/LocalHandlers/BoundsLocalHandler.cs | 32 + .../LocalHandlers/BoundsLocalHandler.cs.meta | 3 + .../LocalHandlers/QuaternionLocalHandler.cs | 54 ++ .../QuaternionLocalHandler.cs.meta | 3 + .../LocalHandlers/Vector2LocalHandler.cs | 37 ++ .../LocalHandlers/Vector2LocalHandler.cs.meta | 3 + .../LocalHandlers/Vector3LocalHandler.cs | 37 ++ .../LocalHandlers/Vector3LocalHandler.cs.meta | 3 + .../Drawers/Gizmo/WorldHandlers.meta | 3 + .../Gizmo/WorldHandlers/BoundsHandler.cs | 25 + .../Gizmo/WorldHandlers/BoundsHandler.cs.meta | 3 + .../Gizmo/WorldHandlers/QuaternionHandler.cs | 47 ++ .../WorldHandlers/QuaternionHandler.cs.meta | 3 + .../Gizmo/WorldHandlers/Vector2Handler.cs | 31 + .../WorldHandlers/Vector2Handler.cs.meta | 3 + .../Gizmo/WorldHandlers/Vector3Handler.cs | 31 + .../WorldHandlers/Vector3Handler.cs.meta | 3 + Editor/EditorAddons/Drawers/HandlerMaps.meta | 3 + .../DrawInspectorTypeHandlerBinder.cs | 35 ++ .../DrawInspectorTypeHandlerBinder.cs.meta | 3 + .../HandlerMaps/GizmoTypeHandlerBinder.cs | 50 ++ .../GizmoTypeHandlerBinder.cs.meta | 3 + .../ManipulateTypeHandlerBinder.cs | 41 ++ .../ManipulateTypeHandlerBinder.cs.meta | 3 + .../Drawers/HandlerMaps/MiscBinder.cs | 61 ++ .../Drawers/HandlerMaps/MiscBinder.cs.meta | 3 + .../HandlerMaps/PreviewTypeHandlerBinder.cs | 40 ++ .../PreviewTypeHandlerBinder.cs.meta | 3 + .../HandlerMaps/SelectTypeHandlerBinder.cs | 49 ++ .../SelectTypeHandlerBinder.cs.meta | 3 + Editor/EditorAddons/Drawers/Manipulation.meta | 3 + .../Drawers/Manipulation/Handlers.meta | 3 + .../Handlers/InEditorModeHandler.cs | 12 + .../Handlers/InEditorModeHandler.cs.meta | 3 + .../Handlers/InPlayModeHandler.cs | 12 + .../Handlers/InPlayModeHandler.cs.meta | 3 + .../Handlers/ManipulateHandler.cs | 57 ++ .../Handlers/ManipulateHandler.cs.meta | 3 + .../ManipulateUserConditionHandler.cs | 55 ++ .../ManipulateUserConditionHandler.cs.meta | 3 + .../Handlers/ReadOnlyFieldAttributeHandler.cs | 10 + .../ReadOnlyFieldAttributeHandler.cs.meta | 3 + .../Drawers/Manipulation/ManipulateDrawer.cs | 25 + .../Manipulation/ManipulateDrawer.cs.meta | 3 + Editor/EditorAddons/Drawers/Misc.meta | 3 + .../EditorAddons/Drawers/Misc/Handlers.meta | 3 + .../Misc/Handlers/CustomToolTipHandler.cs | 23 + .../Handlers/CustomToolTipHandler.cs.meta | 3 + .../Misc/Handlers/EnumButtonsHandler.cs | 93 +++ .../Misc/Handlers/EnumButtonsHandler.cs.meta | 3 + .../Drawers/Misc/Handlers/HelpBoxHandler.cs | 27 + .../Misc/Handlers/HelpBoxHandler.cs.meta | 3 + .../Drawers/Misc/Handlers/HideLabelHandler.cs | 39 ++ .../Misc/Handlers/HideLabelHandler.cs.meta | 3 + .../Drawers/Misc/Handlers/MiscHandler.cs | 29 + .../Drawers/Misc/Handlers/MiscHandler.cs.meta | 3 + .../Drawers/Misc/Handlers/MiscLabelHandler.cs | 15 + .../Misc/Handlers/MiscLabelHandler.cs.meta | 3 + .../Misc/Handlers/RenameFieldHandler.cs | 15 + .../Misc/Handlers/RenameFieldHandler.cs.meta | 3 + .../EditorAddons/Drawers/Misc/MiscDrawer.cs | 18 + .../Drawers/Misc/MiscDrawer.cs.meta | 3 + Editor/EditorAddons/Drawers/Preview.meta | 3 + .../Drawers/Preview/Handlers.meta | 3 + .../Drawers/Preview/Handlers/AssetHandler.cs | 66 ++ .../Preview/Handlers/AssetHandler.cs.meta | 3 + .../Preview/Handlers/PreviewHandler.cs | 127 ++++ .../Preview/Handlers/PreviewHandler.cs.meta | 3 + .../Drawers/Preview/Handlers/SpriteHandler.cs | 29 + .../Preview/Handlers/SpriteHandler.cs.meta | 3 + .../Preview/Handlers/TextureHandler.cs | 48 ++ .../Preview/Handlers/TextureHandler.cs.meta | 3 + .../Drawers/Preview/PreviewDrawer.cs | 71 +++ .../Drawers/Preview/PreviewDrawer.cs.meta | 3 + .../Drawers/Preview/PreviewSceneRenderer.cs | 111 ++++ .../Preview/PreviewSceneRenderer.cs.meta | 3 + Editor/EditorAddons/Drawers/Select.meta | 8 + .../EditorAddons/Drawers/Select/Handlers.meta | 3 + .../Select/Handlers/BaseSelectHandler.cs | 156 +++++ .../Select/Handlers/BaseSelectHandler.cs.meta | 3 + .../Select/Handlers/BaseSelectTypeHandler.cs | 120 ++++ .../Handlers/BaseSelectTypeHandler.cs.meta | 3 + .../Select/Handlers/DropdownCollection.meta | 3 + .../DictionaryCollection.cs | 74 +++ .../DictionaryCollection.cs.meta | 3 + .../EnumerableCollection.cs | 90 +++ .../EnumerableCollection.cs.meta | 3 + .../DropdownCollection/IDataCollection.cs | 10 + .../IDataCollection.cs.meta | 3 + .../DropdownCollection/KeyTupleComparer.cs | 22 + .../KeyTupleComparer.cs.meta | 3 + .../DropdownCollection/NoneCollection.cs | 19 + .../DropdownCollection/NoneCollection.cs.meta | 3 + .../Select/Handlers/DropdownHandler.cs | 176 ++++++ .../Select/Handlers/DropdownHandler.cs.meta | 3 + .../Select/Handlers/SelectEnumHandler.cs | 185 ++++++ .../Select/Handlers/SelectEnumHandler.cs.meta | 3 + .../Handlers/SelectImplementationHandler.cs | 108 ++++ .../SelectImplementationHandler.cs.meta | 3 + .../Handlers/SelectSerializedTypeHandler.cs | 167 ++++++ .../SelectSerializedTypeHandler.cs.meta | 3 + .../Drawers/Select/SelectDrawer.cs | 133 ++++ .../Drawers/Select/SelectDrawer.cs.meta | 3 + .../Drawers/Select/SelectElementBehaviour.cs | 19 + .../Select/SelectElementBehaviour.cs.meta | 3 + Editor/EditorAddons/Drawers/Validation.meta | 3 + .../Drawers/Validation/Drawers.meta | 3 + .../Validation/Drawers/ValidationDrawer.cs | 36 ++ .../Drawers/ValidationDrawer.cs.meta | 11 + .../Drawers/Validation/Extensions.meta | 3 + .../Extensions/ValidationExtensions.cs | 32 + .../Extensions/ValidationExtensions.cs.meta | 3 + .../Extensions/ValidationWrapperExtensions.cs | 15 + .../ValidationWrapperExtensions.cs.meta | 3 + .../Drawers/Validation/Handlers.meta | 3 + .../Validation/Handlers/ClampWrapper.cs | 56 ++ .../Validation/Handlers/ClampWrapper.cs.meta | 3 + .../Handlers/DataValidationHandler.cs | 86 +++ .../Handlers/DataValidationHandler.cs.meta | 3 + .../Handlers/FindComponentHandler.cs | 82 +++ .../Handlers/FindComponentHandler.cs.meta | 3 + .../Drawers/Validation/Handlers/MaxWrapper.cs | 53 ++ .../Validation/Handlers/MaxWrapper.cs.meta | 3 + .../Handlers/MissingComponentHandler.cs | 45 ++ .../Handlers/MissingComponentHandler.cs.meta | 3 + .../Handlers/MissingReferenceHandler.cs | 29 + .../Handlers/MissingReferenceHandler.cs.meta | 3 + .../Validation/Handlers/NotNullHandler.cs | 37 ++ .../Handlers/NotNullHandler.cs.meta | 3 + .../Validation/Handlers/PrefabHandler.cs | 38 ++ .../Validation/Handlers/PrefabHandler.cs.meta | 3 + .../Handlers/PropertyValidationHandler.cs | 35 ++ .../PropertyValidationHandler.cs.meta | 3 + .../Handlers/SceneReferenceHandler.cs | 90 +++ .../Handlers/SceneReferenceHandler.cs.meta | 3 + .../Validation/Handlers/ValidationHandler.cs | 30 + .../Handlers/ValidationHandler.cs.meta | 3 + .../Validation/Handlers/ValidationValue.cs | 15 + .../Handlers/ValidationValue.cs.meta | 3 + .../Validation/ValidationAttributeBinder.cs | 38 ++ .../ValidationAttributeBinder.cs.meta | 3 + Editor/EditorAddons/Extensions.meta | 3 + .../Extensions/AttributesDefinitions.cs | 7 + .../Extensions/AttributesDefinitions.cs.meta | 3 + .../Extensions/EnumSetterExtension.cs | 36 ++ .../Extensions/EnumSetterExtension.cs.meta | 3 + .../TextureImporterMenuExtensions.cs | 22 + .../TextureImporterMenuExtensions.cs.meta | 3 + LICENSE | 21 + LICENSE.meta | 7 + README.md | 225 +++++++ README.md.meta | 7 + Runtime.meta | 8 + Runtime/Attributes.meta | 3 + Runtime/Attributes/DrawInspector.meta | 3 + .../DrawInspector/DrawInspectorAttribute.cs | 16 + .../DrawInspectorAttribute.cs.meta | 3 + Runtime/Attributes/EditorButtonAttribute.cs | 48 ++ .../Attributes/EditorButtonAttribute.cs.meta | 11 + Runtime/Attributes/Gizmo.meta | 3 + .../Attributes/Gizmo/BaseGizmoAttribute.cs | 14 + .../Gizmo/BaseGizmoAttribute.cs.meta | 3 + Runtime/Attributes/Gizmo/GizmoAttribute.cs | 14 + .../Attributes/Gizmo/GizmoAttribute.cs.meta | 3 + .../Attributes/Gizmo/GizmoLocalAttribute.cs | 17 + .../Gizmo/GizmoLocalAttribute.cs.meta | 3 + Runtime/Attributes/Headers.meta | 8 + .../Attributes/Headers/IconHeaderAttribute.cs | 24 + .../Headers/IconHeaderAttribute.cs.meta | 3 + .../Headers/PrefabHeaderAttribute.cs | 19 + .../Headers/PrefabHeaderAttribute.cs.meta | 3 + .../Headers/ReferencesHeaderAttribute.cs | 19 + .../Headers/ReferencesHeaderAttribute.cs.meta | 3 + .../Headers/SettingsHeaderAttribute.cs | 26 + .../Headers/SettingsHeaderAttribute.cs.meta | 3 + .../Headers/StateHeaderAttribute.cs | 19 + .../Headers/StateHeaderAttribute.cs.meta | 3 + Runtime/Attributes/Manipulation.meta | 8 + .../Manipulation/DisableIfAttribute.cs | 15 + .../Manipulation/DisableIfAttribute.cs.meta | 3 + .../DisableInEditorModeAttribute.cs | 15 + .../DisableInEditorModeAttribute.cs.meta | 3 + .../DisableInPlayModeAttribute.cs | 15 + .../DisableInPlayModeAttribute.cs.meta | 3 + .../Manipulation/EnableIfAttribute.cs | 15 + .../Manipulation/EnableIfAttribute.cs.meta | 3 + .../EnableInEditorModeAttribute.cs | 15 + .../EnableInEditorModeAttribute.cs.meta | 3 + .../Manipulation/EnableInPlayModeAttribute.cs | 15 + .../EnableInPlayModeAttribute.cs.meta | 3 + .../Manipulation/HideIfAttribute.cs | 15 + .../Manipulation/HideIfAttribute.cs.meta | 3 + .../Manipulation/HideInEditorModeAttribute.cs | 15 + .../HideInEditorModeAttribute.cs.meta | 3 + .../Manipulation/HideInPlayModeAttribute.cs | 15 + .../HideInPlayModeAttribute.cs.meta | 3 + .../Manipulation/ManipulateAttribute.cs | 28 + .../Manipulation/ManipulateAttribute.cs.meta | 3 + .../ManipulateUserConditionAttribute.cs | 21 + .../ManipulateUserConditionAttribute.cs.meta | 3 + .../Manipulation/ReadOnlyAttribute.cs | 18 + .../Manipulation/ReadOnlyAttribute.cs.meta | 3 + .../Manipulation/ShowIfAttribute.cs | 15 + .../Manipulation/ShowIfAttribute.cs.meta | 3 + .../Manipulation/ShowInEditorModeAttribute.cs | 15 + .../ShowInEditorModeAttribute.cs.meta | 3 + .../Manipulation/ShowInPlayModeAttribute.cs | 16 + .../ShowInPlayModeAttribute.cs.meta | 3 + Runtime/Attributes/Misc.meta | 3 + .../Attributes/Misc/CustomTooltipAttribute.cs | 21 + .../Misc/CustomTooltipAttribute.cs.meta | 3 + .../Attributes/Misc/EnumButtonsAttribute.cs | 16 + .../Misc/EnumButtonsAttribute.cs.meta | 3 + Runtime/Attributes/Misc/HelpBoxAttribute.cs | 18 + .../Attributes/Misc/HelpBoxAttribute.cs.meta | 3 + Runtime/Attributes/Misc/HideLabelAttribute.cs | 16 + .../Misc/HideLabelAttribute.cs.meta | 3 + Runtime/Attributes/Misc/MiscAttribute.cs | 14 + Runtime/Attributes/Misc/MiscAttribute.cs.meta | 3 + .../Attributes/Misc/RenameFieldAttribute.cs | 18 + .../Misc/RenameFieldAttribute.cs.meta | 3 + Runtime/Attributes/Preview.meta | 3 + .../Attributes/Preview/PreviewAttribute.cs | 30 + .../Preview/PreviewAttribute.cs.meta | 3 + Runtime/Attributes/Select.meta | 8 + .../Attributes/Select/DropdownAttribute.cs | 33 + .../Select/DropdownAttribute.cs.meta | 3 + Runtime/Attributes/Select/SelectAttribute.cs | 39 ++ .../Attributes/Select/SelectAttribute.cs.meta | 3 + .../Attributes/Select/SelectAttributeBase.cs | 67 +++ .../Select/SelectAttributeBase.cs.meta | 11 + .../Attributes/Select/SelectEnumAttribute.cs | 32 + .../Select/SelectEnumAttribute.cs.meta | 11 + Runtime/Attributes/Validation.meta | 3 + .../Attributes/Validation/ClampAttribute.cs | 20 + .../Validation/ClampAttribute.cs.meta | 3 + .../Validation/DataValidationAttribute.cs | 18 + .../DataValidationAttribute.cs.meta | 3 + .../Attributes/Validation/FindAttribute.cs | 31 + .../Validation/FindAttribute.cs.meta | 3 + Runtime/Attributes/Validation/MaxAttribute.cs | 18 + .../Validation/MaxAttribute.cs.meta | 3 + .../Attributes/Validation/NotNullAttribute.cs | 12 + .../Validation/NotNullAttribute.cs.meta | 3 + .../Validation/PrefabReferenceAttribute.cs | 12 + .../PrefabReferenceAttribute.cs.meta | 3 + .../Validation/SceneReferenceAttribute.cs | 13 + .../SceneReferenceAttribute.cs.meta | 3 + .../Validation/ValidationAttribute.cs | 21 + .../Validation/ValidationAttribute.cs.meta | 3 + Runtime/BetterAttributes.Runtime.asmdef | 17 + Runtime/BetterAttributes.Runtime.asmdef.meta | 7 + Runtime/EditorButtonUtility.cs | 49 ++ Runtime/EditorButtonUtility.cs.meta | 11 + Runtime/LabelDefines.cs | 12 + Runtime/LabelDefines.cs.meta | 3 + Samples~/TestSamples.meta | 8 + Samples~/TestSamples/GameObject.prefab | 263 ++++++++ Samples~/TestSamples/GameObject.prefab.meta | 7 + Samples~/TestSamples/New Prefab.prefab | 473 +++++++++++++++ Samples~/TestSamples/New Prefab.prefab.meta | 7 + Samples~/TestSamples/Scenes.meta | 8 + Samples~/TestSamples/Scenes/Sample.unity | 567 ++++++++++++++++++ Samples~/TestSamples/Scenes/Sample.unity.meta | 7 + Samples~/TestSamples/Scripts.meta | 8 + Samples~/TestSamples/Scripts/Interfaces.meta | 3 + .../Scripts/Interfaces/ISomeInterface.cs | 6 + .../Scripts/Interfaces/ISomeInterface.cs.meta | 3 + Samples~/TestSamples/Scripts/Models.meta | 3 + .../Scripts/Models/SomeAbstractClass.cs | 10 + .../Scripts/Models/SomeAbstractClass.cs.meta | 3 + .../SomeAbstractClassImplementation1.cs | 18 + .../SomeAbstractClassImplementation1.cs.meta | 3 + .../SomeAbstractClassImplementation2.cs | 20 + .../SomeAbstractClassImplementation2.cs.meta | 3 + .../TestSamples/Scripts/Models/SomeClass.cs | 17 + .../Scripts/Models/SomeClass.cs.meta | 3 + .../Models/SomeInterfaceImplementation17.cs | 12 + .../SomeInterfaceImplementation17.cs.meta | 3 + .../Models/SomeInterfaceImplementation2.cs | 12 + .../SomeInterfaceImplementation2.cs.meta | 3 + .../Models/SomeInterfaceImplementation21.cs | 12 + .../SomeInterfaceImplementation21.cs.meta | 3 + .../Models/SomeInterfaceImplementation3.cs | 12 + .../SomeInterfaceImplementation3.cs.meta | 3 + Samples~/TestSamples/Scripts/OtherModels.meta | 3 + .../SomeInterfaceImplementation1.cs | 15 + .../SomeInterfaceImplementation1.cs.meta | 3 + .../SomeInterfaceImplementation14.cs | 12 + .../SomeInterfaceImplementation14.cs.meta | 3 + .../SomeInterfaceImplementation15.cs | 12 + .../SomeInterfaceImplementation15.cs.meta | 3 + .../SomeInterfaceImplementation16.cs | 12 + .../SomeInterfaceImplementation16.cs.meta | 3 + Samples~/TestSamples/Scripts/PreviewTest.cs | 13 + .../TestSamples/Scripts/PreviewTest.cs.meta | 3 + Samples~/TestSamples/Scripts/RemovableTest.cs | 19 + .../TestSamples/Scripts/RemovableTest.cs.meta | 11 + Samples~/TestSamples/Scripts/SingletonTest.cs | 41 ++ .../TestSamples/Scripts/SingletonTest.cs.meta | 3 + Samples~/TestSamples/Scripts/Test.cs | 243 ++++++++ Samples~/TestSamples/Scripts/Test.cs.meta | 11 + Samples~/TestSamples/Scripts/Test2.cs | 56 ++ Samples~/TestSamples/Scripts/Test2.cs.meta | 3 + Samples~/TestSamples/Scripts/TestInherit.cs | 13 + .../TestSamples/Scripts/TestInherit.cs.meta | 3 + Samples~/TestSamples/Scripts/TestInherit1.cs | 7 + .../TestSamples/Scripts/TestInherit1.cs.meta | 3 + .../Scripts/TestScriptableObject.cs | 86 +++ .../Scripts/TestScriptableObject.cs.meta | 11 + .../TestSamples/TestScriptableObject 1.asset | 37 ++ .../TestScriptableObject 1.asset.meta | 8 + .../TestSamples/TestScriptableObject.asset | 44 ++ .../TestScriptableObject.asset.meta | 8 + Samples~/TestSamples/logo-social.png | Bin 0 -> 8713 bytes Samples~/TestSamples/logo-social.png.meta | 146 +++++ package.json | 32 + package.json.meta | 3 + 360 files changed, 8600 insertions(+) create mode 100644 Editor.meta create mode 100644 Editor/BetterAttributes.Editor.asmdef create mode 100644 Editor/BetterAttributes.Editor.asmdef.meta create mode 100644 Editor/EditorAddons.meta create mode 100644 Editor/EditorAddons/Comparers.meta create mode 100644 Editor/EditorAddons/Comparers/AnyTypeComparer.cs create mode 100644 Editor/EditorAddons/Comparers/AnyTypeComparer.cs.meta create mode 100644 Editor/EditorAddons/CustomEditors.meta create mode 100644 Editor/EditorAddons/CustomEditors/ButtonsEditor.cs create mode 100644 Editor/EditorAddons/CustomEditors/ButtonsEditor.cs.meta create mode 100644 Editor/EditorAddons/CustomEditors/GizmosEditor.cs create mode 100644 Editor/EditorAddons/CustomEditors/GizmosEditor.cs.meta create mode 100644 Editor/EditorAddons/Drawers.meta create mode 100644 Editor/EditorAddons/Drawers/Decorators.meta create mode 100644 Editor/EditorAddons/Drawers/Decorators/IconHeaderDrawer.cs create mode 100644 Editor/EditorAddons/Drawers/Decorators/IconHeaderDrawer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs create mode 100644 Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs create mode 100644 Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs create mode 100644 Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs create mode 100644 Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/DrawInspector.meta create mode 100644 Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs create mode 100644 Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorHandler.cs create mode 100644 Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/BaseHandlers.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs create mode 100644 Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/GizmoElementBehaviour.cs create mode 100644 Editor/EditorAddons/Drawers/Gizmo/GizmoElementBehaviour.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/HideTransformDrawer.cs create mode 100644 Editor/EditorAddons/Drawers/Gizmo/HideTransformDrawer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/LocalHandlers.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/BoundsLocalHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/QuaternionLocalHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/Vector2LocalHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Gizmo/LocalHandlers/Vector3LocalHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/WorldHandlers.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/BoundsHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/QuaternionHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs create mode 100644 Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/Vector2Handler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs create mode 100644 Editor/EditorAddons/Drawers/Gizmo/WorldHandlers/Vector3Handler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/HandlerMaps.meta create mode 100644 Editor/EditorAddons/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs create mode 100644 Editor/EditorAddons/Drawers/HandlerMaps/DrawInspectorTypeHandlerBinder.cs.meta create mode 100644 Editor/EditorAddons/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs create mode 100644 Editor/EditorAddons/Drawers/HandlerMaps/GizmoTypeHandlerBinder.cs.meta create mode 100644 Editor/EditorAddons/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs create mode 100644 Editor/EditorAddons/Drawers/HandlerMaps/ManipulateTypeHandlerBinder.cs.meta create mode 100644 Editor/EditorAddons/Drawers/HandlerMaps/MiscBinder.cs create mode 100644 Editor/EditorAddons/Drawers/HandlerMaps/MiscBinder.cs.meta create mode 100644 Editor/EditorAddons/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs create mode 100644 Editor/EditorAddons/Drawers/HandlerMaps/PreviewTypeHandlerBinder.cs.meta create mode 100644 Editor/EditorAddons/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs create mode 100644 Editor/EditorAddons/Drawers/HandlerMaps/SelectTypeHandlerBinder.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Manipulation.meta create mode 100644 Editor/EditorAddons/Drawers/Manipulation/Handlers.meta create mode 100644 Editor/EditorAddons/Drawers/Manipulation/Handlers/InEditorModeHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Manipulation/Handlers/InEditorModeHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Manipulation/Handlers/InPlayModeHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Manipulation/Handlers/InPlayModeHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Manipulation/Handlers/ManipulateHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Manipulation/Handlers/ManipulateHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Manipulation/Handlers/ManipulateUserConditionHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Manipulation/Handlers/ReadOnlyFieldAttributeHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Manipulation/ManipulateDrawer.cs create mode 100644 Editor/EditorAddons/Drawers/Manipulation/ManipulateDrawer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Misc.meta create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers.meta create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/CustomToolTipHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/CustomToolTipHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/EnumButtonsHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/EnumButtonsHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/HelpBoxHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/HelpBoxHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/HideLabelHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/HideLabelHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/MiscHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/MiscHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/MiscLabelHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/MiscLabelHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/RenameFieldHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Misc/Handlers/RenameFieldHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Misc/MiscDrawer.cs create mode 100644 Editor/EditorAddons/Drawers/Misc/MiscDrawer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Preview.meta create mode 100644 Editor/EditorAddons/Drawers/Preview/Handlers.meta create mode 100644 Editor/EditorAddons/Drawers/Preview/Handlers/AssetHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Preview/Handlers/AssetHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Preview/Handlers/PreviewHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Preview/Handlers/PreviewHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Preview/Handlers/SpriteHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Preview/Handlers/SpriteHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Preview/Handlers/TextureHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Preview/Handlers/TextureHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs create mode 100644 Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Preview/PreviewSceneRenderer.cs create mode 100644 Editor/EditorAddons/Drawers/Preview/PreviewSceneRenderer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Select.meta create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers.meta create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/BaseSelectHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/BaseSelectHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/BaseSelectTypeHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/BaseSelectTypeHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection.meta create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/DictionaryCollection.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/EnumerableCollection.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/IDataCollection.cs create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/IDataCollection.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/KeyTupleComparer.cs create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/KeyTupleComparer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/NoneCollection.cs create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/DropdownCollection/NoneCollection.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/DropdownHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/DropdownHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/SelectEnumHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/SelectEnumHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/SelectImplementationHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/SelectImplementationHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Select/Handlers/SelectSerializedTypeHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Select/SelectDrawer.cs create mode 100644 Editor/EditorAddons/Drawers/Select/SelectDrawer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Select/SelectElementBehaviour.cs create mode 100644 Editor/EditorAddons/Drawers/Select/SelectElementBehaviour.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Drawers.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Drawers/ValidationDrawer.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Drawers/ValidationDrawer.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Extensions.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Extensions/ValidationExtensions.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Extensions/ValidationExtensions.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Extensions/ValidationWrapperExtensions.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Extensions/ValidationWrapperExtensions.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/ClampWrapper.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/ClampWrapper.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/DataValidationHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/DataValidationHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/FindComponentHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/FindComponentHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/MaxWrapper.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/MaxWrapper.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/MissingComponentHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/MissingComponentHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/MissingReferenceHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/MissingReferenceHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/NotNullHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/NotNullHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/PrefabHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/PrefabHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/PropertyValidationHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/PropertyValidationHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/SceneReferenceHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/SceneReferenceHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/ValidationHandler.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/ValidationHandler.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/ValidationValue.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/Handlers/ValidationValue.cs.meta create mode 100644 Editor/EditorAddons/Drawers/Validation/ValidationAttributeBinder.cs create mode 100644 Editor/EditorAddons/Drawers/Validation/ValidationAttributeBinder.cs.meta create mode 100644 Editor/EditorAddons/Extensions.meta create mode 100644 Editor/EditorAddons/Extensions/AttributesDefinitions.cs create mode 100644 Editor/EditorAddons/Extensions/AttributesDefinitions.cs.meta create mode 100644 Editor/EditorAddons/Extensions/EnumSetterExtension.cs create mode 100644 Editor/EditorAddons/Extensions/EnumSetterExtension.cs.meta create mode 100644 Editor/EditorAddons/Extensions/TextureImporterMenuExtensions.cs create mode 100644 Editor/EditorAddons/Extensions/TextureImporterMenuExtensions.cs.meta create mode 100644 LICENSE create mode 100644 LICENSE.meta create mode 100644 README.md create mode 100644 README.md.meta create mode 100644 Runtime.meta create mode 100644 Runtime/Attributes.meta create mode 100644 Runtime/Attributes/DrawInspector.meta create mode 100644 Runtime/Attributes/DrawInspector/DrawInspectorAttribute.cs create mode 100644 Runtime/Attributes/DrawInspector/DrawInspectorAttribute.cs.meta create mode 100644 Runtime/Attributes/EditorButtonAttribute.cs create mode 100644 Runtime/Attributes/EditorButtonAttribute.cs.meta create mode 100644 Runtime/Attributes/Gizmo.meta create mode 100644 Runtime/Attributes/Gizmo/BaseGizmoAttribute.cs create mode 100644 Runtime/Attributes/Gizmo/BaseGizmoAttribute.cs.meta create mode 100644 Runtime/Attributes/Gizmo/GizmoAttribute.cs create mode 100644 Runtime/Attributes/Gizmo/GizmoAttribute.cs.meta create mode 100644 Runtime/Attributes/Gizmo/GizmoLocalAttribute.cs create mode 100644 Runtime/Attributes/Gizmo/GizmoLocalAttribute.cs.meta create mode 100644 Runtime/Attributes/Headers.meta create mode 100644 Runtime/Attributes/Headers/IconHeaderAttribute.cs create mode 100644 Runtime/Attributes/Headers/IconHeaderAttribute.cs.meta create mode 100644 Runtime/Attributes/Headers/PrefabHeaderAttribute.cs create mode 100644 Runtime/Attributes/Headers/PrefabHeaderAttribute.cs.meta create mode 100644 Runtime/Attributes/Headers/ReferencesHeaderAttribute.cs create mode 100644 Runtime/Attributes/Headers/ReferencesHeaderAttribute.cs.meta create mode 100644 Runtime/Attributes/Headers/SettingsHeaderAttribute.cs create mode 100644 Runtime/Attributes/Headers/SettingsHeaderAttribute.cs.meta create mode 100644 Runtime/Attributes/Headers/StateHeaderAttribute.cs create mode 100644 Runtime/Attributes/Headers/StateHeaderAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation.meta create mode 100644 Runtime/Attributes/Manipulation/DisableIfAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/DisableIfAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/DisableInEditorModeAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/DisableInEditorModeAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/DisableInPlayModeAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/DisableInPlayModeAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/EnableIfAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/EnableIfAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/EnableInEditorModeAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/EnableInEditorModeAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/EnableInPlayModeAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/EnableInPlayModeAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/HideIfAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/HideIfAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/HideInEditorModeAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/HideInEditorModeAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/HideInPlayModeAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/HideInPlayModeAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/ManipulateAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/ManipulateAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/ManipulateUserConditionAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/ManipulateUserConditionAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/ReadOnlyAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/ReadOnlyAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/ShowIfAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/ShowIfAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/ShowInEditorModeAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/ShowInEditorModeAttribute.cs.meta create mode 100644 Runtime/Attributes/Manipulation/ShowInPlayModeAttribute.cs create mode 100644 Runtime/Attributes/Manipulation/ShowInPlayModeAttribute.cs.meta create mode 100644 Runtime/Attributes/Misc.meta create mode 100644 Runtime/Attributes/Misc/CustomTooltipAttribute.cs create mode 100644 Runtime/Attributes/Misc/CustomTooltipAttribute.cs.meta create mode 100644 Runtime/Attributes/Misc/EnumButtonsAttribute.cs create mode 100644 Runtime/Attributes/Misc/EnumButtonsAttribute.cs.meta create mode 100644 Runtime/Attributes/Misc/HelpBoxAttribute.cs create mode 100644 Runtime/Attributes/Misc/HelpBoxAttribute.cs.meta create mode 100644 Runtime/Attributes/Misc/HideLabelAttribute.cs create mode 100644 Runtime/Attributes/Misc/HideLabelAttribute.cs.meta create mode 100644 Runtime/Attributes/Misc/MiscAttribute.cs create mode 100644 Runtime/Attributes/Misc/MiscAttribute.cs.meta create mode 100644 Runtime/Attributes/Misc/RenameFieldAttribute.cs create mode 100644 Runtime/Attributes/Misc/RenameFieldAttribute.cs.meta create mode 100644 Runtime/Attributes/Preview.meta create mode 100644 Runtime/Attributes/Preview/PreviewAttribute.cs create mode 100644 Runtime/Attributes/Preview/PreviewAttribute.cs.meta create mode 100644 Runtime/Attributes/Select.meta create mode 100644 Runtime/Attributes/Select/DropdownAttribute.cs create mode 100644 Runtime/Attributes/Select/DropdownAttribute.cs.meta create mode 100644 Runtime/Attributes/Select/SelectAttribute.cs create mode 100644 Runtime/Attributes/Select/SelectAttribute.cs.meta create mode 100644 Runtime/Attributes/Select/SelectAttributeBase.cs create mode 100644 Runtime/Attributes/Select/SelectAttributeBase.cs.meta create mode 100644 Runtime/Attributes/Select/SelectEnumAttribute.cs create mode 100644 Runtime/Attributes/Select/SelectEnumAttribute.cs.meta create mode 100644 Runtime/Attributes/Validation.meta create mode 100644 Runtime/Attributes/Validation/ClampAttribute.cs create mode 100644 Runtime/Attributes/Validation/ClampAttribute.cs.meta create mode 100644 Runtime/Attributes/Validation/DataValidationAttribute.cs create mode 100644 Runtime/Attributes/Validation/DataValidationAttribute.cs.meta create mode 100644 Runtime/Attributes/Validation/FindAttribute.cs create mode 100644 Runtime/Attributes/Validation/FindAttribute.cs.meta create mode 100644 Runtime/Attributes/Validation/MaxAttribute.cs create mode 100644 Runtime/Attributes/Validation/MaxAttribute.cs.meta create mode 100644 Runtime/Attributes/Validation/NotNullAttribute.cs create mode 100644 Runtime/Attributes/Validation/NotNullAttribute.cs.meta create mode 100644 Runtime/Attributes/Validation/PrefabReferenceAttribute.cs create mode 100644 Runtime/Attributes/Validation/PrefabReferenceAttribute.cs.meta create mode 100644 Runtime/Attributes/Validation/SceneReferenceAttribute.cs create mode 100644 Runtime/Attributes/Validation/SceneReferenceAttribute.cs.meta create mode 100644 Runtime/Attributes/Validation/ValidationAttribute.cs create mode 100644 Runtime/Attributes/Validation/ValidationAttribute.cs.meta create mode 100644 Runtime/BetterAttributes.Runtime.asmdef create mode 100644 Runtime/BetterAttributes.Runtime.asmdef.meta create mode 100644 Runtime/EditorButtonUtility.cs create mode 100644 Runtime/EditorButtonUtility.cs.meta create mode 100644 Runtime/LabelDefines.cs create mode 100644 Runtime/LabelDefines.cs.meta create mode 100644 Samples~/TestSamples.meta create mode 100644 Samples~/TestSamples/GameObject.prefab create mode 100644 Samples~/TestSamples/GameObject.prefab.meta create mode 100644 Samples~/TestSamples/New Prefab.prefab create mode 100644 Samples~/TestSamples/New Prefab.prefab.meta create mode 100644 Samples~/TestSamples/Scenes.meta create mode 100644 Samples~/TestSamples/Scenes/Sample.unity create mode 100644 Samples~/TestSamples/Scenes/Sample.unity.meta create mode 100644 Samples~/TestSamples/Scripts.meta create mode 100644 Samples~/TestSamples/Scripts/Interfaces.meta create mode 100644 Samples~/TestSamples/Scripts/Interfaces/ISomeInterface.cs create mode 100644 Samples~/TestSamples/Scripts/Interfaces/ISomeInterface.cs.meta create mode 100644 Samples~/TestSamples/Scripts/Models.meta create mode 100644 Samples~/TestSamples/Scripts/Models/SomeAbstractClass.cs create mode 100644 Samples~/TestSamples/Scripts/Models/SomeAbstractClass.cs.meta create mode 100644 Samples~/TestSamples/Scripts/Models/SomeAbstractClassImplementation1.cs create mode 100644 Samples~/TestSamples/Scripts/Models/SomeAbstractClassImplementation1.cs.meta create mode 100644 Samples~/TestSamples/Scripts/Models/SomeAbstractClassImplementation2.cs create mode 100644 Samples~/TestSamples/Scripts/Models/SomeAbstractClassImplementation2.cs.meta create mode 100644 Samples~/TestSamples/Scripts/Models/SomeClass.cs create mode 100644 Samples~/TestSamples/Scripts/Models/SomeClass.cs.meta create mode 100644 Samples~/TestSamples/Scripts/Models/SomeInterfaceImplementation17.cs create mode 100644 Samples~/TestSamples/Scripts/Models/SomeInterfaceImplementation17.cs.meta create mode 100644 Samples~/TestSamples/Scripts/Models/SomeInterfaceImplementation2.cs create mode 100644 Samples~/TestSamples/Scripts/Models/SomeInterfaceImplementation2.cs.meta create mode 100644 Samples~/TestSamples/Scripts/Models/SomeInterfaceImplementation21.cs create mode 100644 Samples~/TestSamples/Scripts/Models/SomeInterfaceImplementation21.cs.meta create mode 100644 Samples~/TestSamples/Scripts/Models/SomeInterfaceImplementation3.cs create mode 100644 Samples~/TestSamples/Scripts/Models/SomeInterfaceImplementation3.cs.meta create mode 100644 Samples~/TestSamples/Scripts/OtherModels.meta create mode 100644 Samples~/TestSamples/Scripts/OtherModels/SomeInterfaceImplementation1.cs create mode 100644 Samples~/TestSamples/Scripts/OtherModels/SomeInterfaceImplementation1.cs.meta create mode 100644 Samples~/TestSamples/Scripts/OtherModels/SomeInterfaceImplementation14.cs create mode 100644 Samples~/TestSamples/Scripts/OtherModels/SomeInterfaceImplementation14.cs.meta create mode 100644 Samples~/TestSamples/Scripts/OtherModels/SomeInterfaceImplementation15.cs create mode 100644 Samples~/TestSamples/Scripts/OtherModels/SomeInterfaceImplementation15.cs.meta create mode 100644 Samples~/TestSamples/Scripts/OtherModels/SomeInterfaceImplementation16.cs create mode 100644 Samples~/TestSamples/Scripts/OtherModels/SomeInterfaceImplementation16.cs.meta create mode 100644 Samples~/TestSamples/Scripts/PreviewTest.cs create mode 100644 Samples~/TestSamples/Scripts/PreviewTest.cs.meta create mode 100644 Samples~/TestSamples/Scripts/RemovableTest.cs create mode 100644 Samples~/TestSamples/Scripts/RemovableTest.cs.meta create mode 100644 Samples~/TestSamples/Scripts/SingletonTest.cs create mode 100644 Samples~/TestSamples/Scripts/SingletonTest.cs.meta create mode 100644 Samples~/TestSamples/Scripts/Test.cs create mode 100644 Samples~/TestSamples/Scripts/Test.cs.meta create mode 100644 Samples~/TestSamples/Scripts/Test2.cs create mode 100644 Samples~/TestSamples/Scripts/Test2.cs.meta create mode 100644 Samples~/TestSamples/Scripts/TestInherit.cs create mode 100644 Samples~/TestSamples/Scripts/TestInherit.cs.meta create mode 100644 Samples~/TestSamples/Scripts/TestInherit1.cs create mode 100644 Samples~/TestSamples/Scripts/TestInherit1.cs.meta create mode 100644 Samples~/TestSamples/Scripts/TestScriptableObject.cs create mode 100644 Samples~/TestSamples/Scripts/TestScriptableObject.cs.meta create mode 100644 Samples~/TestSamples/TestScriptableObject 1.asset create mode 100644 Samples~/TestSamples/TestScriptableObject 1.asset.meta create mode 100644 Samples~/TestSamples/TestScriptableObject.asset create mode 100644 Samples~/TestSamples/TestScriptableObject.asset.meta create mode 100644 Samples~/TestSamples/logo-social.png create mode 100644 Samples~/TestSamples/logo-social.png.meta create mode 100644 package.json create mode 100644 package.json.meta diff --git a/Editor.meta b/Editor.meta new file mode 100644 index 0000000..26a7ffc --- /dev/null +++ b/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ff0dcc3c0bdb6f34cb6fdeeca979933f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/BetterAttributes.Editor.asmdef b/Editor/BetterAttributes.Editor.asmdef new file mode 100644 index 0000000..d981188 --- /dev/null +++ b/Editor/BetterAttributes.Editor.asmdef @@ -0,0 +1,21 @@ +{ + "name": "BetterAttributes.Editor", + "rootNamespace": "Better.Attributes.EditorAddons", + "references": [ + "GUID:35101f455c979e94c9a0a4793484b7fd", + "GUID:01df13aca8d01e24a911bcc3e8277031", + "GUID:8bd4b41f8da90144d9006c4d926c9679", + "GUID:55fbe2a01ca11514f94a66e7102c8895" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Editor/BetterAttributes.Editor.asmdef.meta b/Editor/BetterAttributes.Editor.asmdef.meta new file mode 100644 index 0000000..ffbf4f4 --- /dev/null +++ b/Editor/BetterAttributes.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b6053aaf850e1f44ebbe8a655121831f +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/EditorAddons.meta b/Editor/EditorAddons.meta new file mode 100644 index 0000000..e535a52 --- /dev/null +++ b/Editor/EditorAddons.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2723479bb55b0c147952fbbce94104cb +timeCreated: 1660519157 \ No newline at end of file diff --git a/Editor/EditorAddons/Comparers.meta b/Editor/EditorAddons/Comparers.meta new file mode 100644 index 0000000..662de5d --- /dev/null +++ b/Editor/EditorAddons/Comparers.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 40cad780ba9c4d0ea211a433afc6ba6d +timeCreated: 1712746562 \ No newline at end of file diff --git a/Editor/EditorAddons/Comparers/AnyTypeComparer.cs b/Editor/EditorAddons/Comparers/AnyTypeComparer.cs new file mode 100644 index 0000000..d2bde4b --- /dev/null +++ b/Editor/EditorAddons/Comparers/AnyTypeComparer.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using Better.Commons.Runtime.Comparers; + +namespace Better.Attributes.EditorAddons.Comparers +{ + public class AnyTypeComparer : BaseComparer, IEqualityComparer + { + public bool Equals(Type x, Type y) + { + if (ReferenceEquals(x, y)) return true; + if (ReferenceEquals(x, null)) return false; + if (ReferenceEquals(y, null)) return false; + if (x.IsAssignableFrom(y) || x == y) return true; + return x == typeof(Type); + } + + public int GetHashCode(Type obj) + { + return 0; + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Comparers/AnyTypeComparer.cs.meta b/Editor/EditorAddons/Comparers/AnyTypeComparer.cs.meta new file mode 100644 index 0000000..4fe7f74 --- /dev/null +++ b/Editor/EditorAddons/Comparers/AnyTypeComparer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 10f26e1cb5a34f2f87ecfbe79cad1cd2 +timeCreated: 1690411633 \ No newline at end of file diff --git a/Editor/EditorAddons/CustomEditors.meta b/Editor/EditorAddons/CustomEditors.meta new file mode 100644 index 0000000..6098b09 --- /dev/null +++ b/Editor/EditorAddons/CustomEditors.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c11fea05982447bb840a231134b6b14f +timeCreated: 1682216202 \ No newline at end of file diff --git a/Editor/EditorAddons/CustomEditors/ButtonsEditor.cs b/Editor/EditorAddons/CustomEditors/ButtonsEditor.cs new file mode 100644 index 0000000..2bebc90 --- /dev/null +++ b/Editor/EditorAddons/CustomEditors/ButtonsEditor.cs @@ -0,0 +1,108 @@ +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 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); + } + + private Button DrawButton(MethodInfo methodInfo, EditorButtonAttribute attribute) + { + var button = new Button + { + text = attribute.GetDisplayName(methodInfo.PrettyMemberName()), + name = methodInfo.PrettyMemberName() + }; + button.style.FlexGrow(StyleDefinition.OneStyleFloat); + button.RegisterCallback(OnClick, (methodInfo, attribute)); + return button; + } + + private void OnClick(ClickEvent clickEvent, (MethodInfo methodInfo, EditorButtonAttribute attribute) data) + { + _serializedObject.Update(); + data.methodInfo.Invoke(_target, data.attribute.InvokeParams); + EditorUtility.SetDirty(_target); + _serializedObject.ApplyModifiedProperties(); + } + + + private VisualElement DrawButtons(Dictionary>> buttons) + { + var container = new VisualElement(); + + foreach (var button in buttons) + { + if (button.Key == -1) + { + var grouped = button.Value.GroupBy(key => key.Key, pair => pair.Value, + (info, attributes) => new KeyValuePair>(info, attributes)); + var verticalElement = VisualElementUtility.CreateVerticalGroup(); + container.Add(verticalElement); + + foreach (var group in grouped) + { + var horizontalElement = VisualElementUtility.CreateHorizontalGroup(); + verticalElement.Add(horizontalElement); + + foreach (var attribute in group.Value) + { + var buttonElement = DrawButton(group.Key, attribute); + horizontalElement.Add(buttonElement); + } + } + } + else + { + var horizontalElement = VisualElementUtility.CreateHorizontalGroup(); + container.Add(horizontalElement); + foreach (var (key, value) in button.Value) + { + var element = DrawButton(key, value); + horizontalElement.Add(element); + } + } + } + + return container; + } + + public override VisualElement CreateInspectorGUI() + { + var buttons = DrawButtons(_methodButtonsAttributes); + return buttons; + } + + public override void OnChanged(SerializedObject serializedObject) + { + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/CustomEditors/ButtonsEditor.cs.meta b/Editor/EditorAddons/CustomEditors/ButtonsEditor.cs.meta new file mode 100644 index 0000000..c24b446 --- /dev/null +++ b/Editor/EditorAddons/CustomEditors/ButtonsEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 20f290ac9e7e12c47bbd79e0db963b19 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/EditorAddons/CustomEditors/GizmosEditor.cs b/Editor/EditorAddons/CustomEditors/GizmosEditor.cs new file mode 100644 index 0000000..08a6e7c --- /dev/null +++ b/Editor/EditorAddons/CustomEditors/GizmosEditor.cs @@ -0,0 +1,76 @@ +using System.Reflection; +using Better.Attributes.EditorAddons.Drawers.Gizmo; +using Better.Attributes.Runtime.Gizmo; +using Better.Commons.EditorAddons.CustomEditors.Attributes; +using Better.Commons.EditorAddons.CustomEditors.Base; +using Better.Commons.EditorAddons.Extensions; +using UnityEditor; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Better.Attributes.EditorAddons.CustomEditors +{ + [MultiEditor(typeof(Object), true, Order = -999)] + public class GizmosEditor : ExtendedEditor + { + private HideTransformButtonHelper _hideTransformHelper; + + public GizmosEditor(Object target, SerializedObject serializedObject) : base(target, serializedObject) + { + } + + public override void OnDisable() + { + } + + public override void OnEnable() + { + CheckAttribute(); + } + + private void CheckAttribute() + { + var attributeFound = IsAttributeFound(); + + if (attributeFound && !(_serializedObject.targetObject is ScriptableObject)) + { + _hideTransformHelper = new HideTransformButtonHelper(); + } + } + + private bool IsAttributeFound() + { + var iterator = _serializedObject.GetIterator().Copy(); + var attributeFound = false; + while (iterator.Next(true)) + { + var data = iterator.GetFieldInfoAndStaticTypeFromProperty(); + if (data == null) + { + continue; + } + + if (data.FieldInfo.GetCustomAttribute() == null && data.FieldInfo.GetCustomAttribute() == null) continue; + attributeFound = true; + break; + } + + return attributeFound; + } + + public override VisualElement CreateInspectorGUI() + { + if (_hideTransformHelper != null) + { + return _hideTransformHelper.DrawHideTransformButton(); + } + + return null; + } + + public override void OnChanged(SerializedObject serializedObject) + { + CheckAttribute(); + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/CustomEditors/GizmosEditor.cs.meta b/Editor/EditorAddons/CustomEditors/GizmosEditor.cs.meta new file mode 100644 index 0000000..d1bb368 --- /dev/null +++ b/Editor/EditorAddons/CustomEditors/GizmosEditor.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 60771ff3ebf349c2b83d7c4ec8066d93 +timeCreated: 1682216447 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers.meta b/Editor/EditorAddons/Drawers.meta new file mode 100644 index 0000000..917593d --- /dev/null +++ b/Editor/EditorAddons/Drawers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c7b3ee0692f058e44ae1b3acaa3db300 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/EditorAddons/Drawers/Decorators.meta b/Editor/EditorAddons/Drawers/Decorators.meta new file mode 100644 index 0000000..5a5b5d7 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Decorators.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 04e4655c8a5c8d24eaabe0e30685e4bf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/EditorAddons/Drawers/Decorators/IconHeaderDrawer.cs b/Editor/EditorAddons/Drawers/Decorators/IconHeaderDrawer.cs new file mode 100644 index 0000000..e573524 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Decorators/IconHeaderDrawer.cs @@ -0,0 +1,40 @@ +using Better.Attributes.Runtime.Headers; +using UnityEditor; +using UnityEngine; + +namespace Better.Attributes.EditorAddons.Drawers.Decorators +{ + [CustomPropertyDrawer(typeof(IconHeaderAttribute))] + internal sealed class IconHeaderDrawer : DecoratorDrawer + { + private Texture _loadedTexture; + private float _height; + + public override void OnGUI(Rect position) + { + position.yMin += EditorGUIUtility.singleLineHeight * 0.5f; + position = EditorGUI.IndentedRect(position); + if (!(attribute is IconHeaderAttribute iconHeaderAttribute)) return; + if (_loadedTexture == null) + { + var path = AssetDatabase.GUIDToAssetPath(iconHeaderAttribute.Guid); + _loadedTexture = AssetDatabase.LoadAssetAtPath(path); + } + + var texture = (Texture)Texture2D.whiteTexture; + if (_loadedTexture != null) + { + texture = _loadedTexture; + } + + var imageAspect = texture.width / (float)texture.height; + _height = EditorGUIUtility.currentViewWidth / imageAspect; + GUI.DrawTexture(position, texture, ScaleMode.ScaleToFit, iconHeaderAttribute.UseTransparency, imageAspect); + } + + public override float GetHeight() + { + return _height; + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Decorators/IconHeaderDrawer.cs.meta b/Editor/EditorAddons/Drawers/Decorators/IconHeaderDrawer.cs.meta new file mode 100644 index 0000000..4f29576 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Decorators/IconHeaderDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: cb4b39f0ce6741e7b52f95bf84b29927 +timeCreated: 1667430858 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs b/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs new file mode 100644 index 0000000..d9995bc --- /dev/null +++ b/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs @@ -0,0 +1,22 @@ +using Better.Attributes.Runtime.Headers; +using UnityEditor; +using UnityEngine; + +namespace Better.Attributes.EditorAddons.Drawers.Decorators +{ + [CustomPropertyDrawer(typeof(PrefabHeaderAttribute))] + internal sealed class PrefabHeaderDrawer : DecoratorDrawer + { + public override void OnGUI(Rect position) + { + position.yMin += EditorGUIUtility.singleLineHeight * 0.5f; + position = EditorGUI.IndentedRect(position); + GUI.Label(position, (attribute as HeaderAttribute)?.header, EditorStyles.boldLabel); + } + + public override float GetHeight() + { + return EditorGUIUtility.singleLineHeight * 1.5f; + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs.meta b/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs.meta new file mode 100644 index 0000000..d1078e1 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Decorators/PrefabHeaderDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 64a67f7a51654ce42a6d03f440f9b2de +timeCreated: 1615412215 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs b/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs new file mode 100644 index 0000000..4ef5af1 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs @@ -0,0 +1,22 @@ +using Better.Attributes.Runtime.Headers; +using UnityEditor; +using UnityEngine; + +namespace Better.Attributes.EditorAddons.Drawers.Decorators +{ + [CustomPropertyDrawer(typeof(ReferencesHeaderAttribute))] + internal sealed class ReferencesHeaderDrawer : DecoratorDrawer + { + public override void OnGUI(Rect position) + { + position.yMin += EditorGUIUtility.singleLineHeight * 0.5f; + position = EditorGUI.IndentedRect(position); + GUI.Label(position, (attribute as HeaderAttribute)?.header, EditorStyles.boldLabel); + } + + public override float GetHeight() + { + return EditorGUIUtility.singleLineHeight * 1.5f; + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs.meta b/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs.meta new file mode 100644 index 0000000..3fc760d --- /dev/null +++ b/Editor/EditorAddons/Drawers/Decorators/ReferencesHeaderDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 32123521c290f43408c8ea980800d659 +timeCreated: 1615208046 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs b/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs new file mode 100644 index 0000000..8077e3e --- /dev/null +++ b/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs @@ -0,0 +1,22 @@ +using Better.Attributes.Runtime.Headers; +using UnityEditor; +using UnityEngine; + +namespace Better.Attributes.EditorAddons.Drawers.Decorators +{ + [CustomPropertyDrawer(typeof(SettingsHeaderAttribute))] + internal sealed class SettingsHeaderDrawer : DecoratorDrawer + { + public override void OnGUI(Rect position) + { + position.yMin += EditorGUIUtility.singleLineHeight * 0.5f; + position = EditorGUI.IndentedRect(position); + GUI.Label(position, (attribute as HeaderAttribute)?.header, EditorStyles.boldLabel); + } + + public override float GetHeight() + { + return EditorGUIUtility.singleLineHeight * 1.5f; + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs.meta b/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs.meta new file mode 100644 index 0000000..1209be3 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Decorators/SettingsHeaderDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7e3f9c32c859a894d9bf81a83f5ce400 +timeCreated: 1615208046 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs b/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs new file mode 100644 index 0000000..7cc7bc0 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs @@ -0,0 +1,22 @@ +using Better.Attributes.Runtime.Headers; +using UnityEditor; +using UnityEngine; + +namespace Better.Attributes.EditorAddons.Drawers.Decorators +{ + [CustomPropertyDrawer(typeof(StateHeaderAttribute))] + internal sealed class StateHeaderDrawer : DecoratorDrawer + { + public override void OnGUI(Rect position) + { + position.yMin += EditorGUIUtility.singleLineHeight * 0.5f; + position = EditorGUI.IndentedRect(position); + GUI.Label(position, (attribute as HeaderAttribute)?.header, EditorStyles.boldLabel); + } + + public override float GetHeight() + { + return EditorGUIUtility.singleLineHeight * 1.5f; + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs.meta b/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs.meta new file mode 100644 index 0000000..864084a --- /dev/null +++ b/Editor/EditorAddons/Drawers/Decorators/StateHeaderDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 05948c980b372404aa9324e4da1f4d04 +timeCreated: 1615208046 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/DrawInspector.meta b/Editor/EditorAddons/Drawers/DrawInspector.meta new file mode 100644 index 0000000..fd4b896 --- /dev/null +++ b/Editor/EditorAddons/Drawers/DrawInspector.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9dceb237d6e34604985064ad89d91bc6 +timeCreated: 1667575991 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs b/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs new file mode 100644 index 0000000..9482685 --- /dev/null +++ b/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs @@ -0,0 +1,60 @@ +using Better.Attributes.Runtime.DrawInspector; +using Better.Commons.EditorAddons.Drawers; +using Better.Commons.EditorAddons.Drawers.Container; +using Better.Commons.EditorAddons.Enums; +using Better.Commons.EditorAddons.Extensions; +using UnityEditor; +using UnityEditor.UIElements; +using UnityEngine.UIElements; + +namespace Better.Attributes.EditorAddons.Drawers.DrawInspector +{ + [CustomPropertyDrawer(typeof(DrawInspectorAttribute), true)] + public class DrawInspectorDrawer : BasePropertyDrawer + { + protected override void PopulateContainer(ElementsContainer container) + { + var fieldType = GetFieldOrElementType(); + var property = container.SerializedProperty; + if (!TypeHandlersBinder.IsSupported(fieldType)) + { + container.AddNotSupportedBox(fieldType, Attribute.GetType()); + return; + } + + container.SerializedPropertyChanged += OnPropertyChanged; + var handler = GetHandler(property); + + var inspectorElement = handler.GetInspectorContainer(property); + container.CreateElementFrom(inspectorElement); + handler.SetupInspector(); + + var isOpen = handler.IsOpen(); + handler.SetOpen(isOpen); + var iconType = isOpen ? IconType.Minus : IconType.PlusMore; + container.AddClickableIcon(iconType, property, OnIconClickEvent); + } + + private void OnPropertyChanged(ElementsContainer elementsContainer) + { + var handler = GetHandler(elementsContainer.SerializedProperty); + handler.SetupInspector(); + } + + private void OnIconClickEvent(ClickEvent clickEvent, (SerializedProperty property, Image icon) data) + { + UpdateState(data.property, data.icon); + } + + private void UpdateState(SerializedProperty property, Image icon) + { + var handler = GetHandler(property); + if (!handler.CanOpen()) return; + var isOpen = !handler.IsOpen(); + + var iconType = isOpen ? IconType.Minus : IconType.PlusMore; + icon.image = iconType.GetIcon(); + handler.SetOpen(isOpen); + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs.meta b/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs.meta new file mode 100644 index 0000000..2740eb4 --- /dev/null +++ b/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: fbe272ec2b9d4fd5a507d2dee1b84d09 +timeCreated: 1667575999 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorHandler.cs b/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorHandler.cs new file mode 100644 index 0000000..13a206e --- /dev/null +++ b/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorHandler.cs @@ -0,0 +1,98 @@ +using System; +using Better.Commons.EditorAddons.Drawers.Handlers; +using Better.Commons.EditorAddons.Extensions; +using Better.Commons.EditorAddons.Utility; +using Better.Commons.Runtime.Extensions; +using Better.Commons.Runtime.Utility; +using UnityEditor; +using UnityEditor.UIElements; +using UnityEngine.UIElements; + +namespace Better.Attributes.EditorAddons.Drawers.DrawInspector +{ + [Serializable] + public class DrawInspectorHandler : SerializedPropertyHandler + { + private SerializedProperty _property; + private bool _isOpen = false; + private VisualElement _rootElement; + + public DrawInspectorHandler() + { + _rootElement = new VisualElement(); + } + + private void UpdateVisible(VisualElement editorElement) + { + editorElement.style.SetVisible(_isOpen); + } + + public void SetOpen(bool value) + { + _isOpen = value; + UpdateVisible(_rootElement); + ReorderableListUtility.RepaintAllInspectors(_property); + } + + public bool IsOpen() + { + return _isOpen; + } + + public VisualElement GetInspectorContainer(SerializedProperty property) + { + if (property == null) + { + DebugUtility.LogException(nameof(property)); + return null; + } + + _property = property; + return _rootElement; + } + + public void SetupInspector() + { + _rootElement.Clear(); + + if (_property == null || _property.IsDisposed()) + { + DebugUtility.LogException(new ObjectDisposedException(nameof(_property))); + return; + } + + var referenceValue = _property.objectReferenceValue; + if (referenceValue == null) + { + return; + } + + var inspectorElement = new InspectorElement(_property.objectReferenceValue); + UpdateVisible(_rootElement); + _rootElement.Add(inspectorElement); + _rootElement.style.PaddingLeft(StyleDefinition.IndentLevelPadding); + } + + public bool CanOpen() + { + if (_property == null || _property.IsDisposed()) + { + DebugUtility.LogException(new ObjectDisposedException(nameof(_property))); + return false; + } + + var referenceValue = _property.objectReferenceValue; + if (referenceValue == null) + { + return false; + } + + return true; + } + + public override void Deconstruct() + { + _property = null; + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorHandler.cs.meta b/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorHandler.cs.meta new file mode 100644 index 0000000..b1fae42 --- /dev/null +++ b/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorHandler.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 48969434f0bb46f696016b5ba2b0dfac +timeCreated: 1667588521 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo.meta b/Editor/EditorAddons/Drawers/Gizmo.meta new file mode 100644 index 0000000..c514f7a --- /dev/null +++ b/Editor/EditorAddons/Drawers/Gizmo.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8890807caef9ccb40a280c75a5ca62fc +timeCreated: 1658860908 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers.meta b/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers.meta new file mode 100644 index 0000000..49fe016 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f3c4803dca2d276438110209d7242797 +timeCreated: 1658880022 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs b/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs new file mode 100644 index 0000000..a66bc11 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs @@ -0,0 +1,42 @@ +using System; +using UnityEditor; +using UnityEngine; + +namespace Better.Attributes.EditorAddons.Drawers.Gizmo +{ + public abstract class BoundsBaseHandler : GizmoHandler + { + private protected Bounds _previousValue; + + private protected Vector3 DrawSize(Vector3 position) + { + return Handles.ScaleHandle(_previousValue.size, position, Quaternion.identity, + HandleUtility.GetHandleSize(position) * 0.7f); + } + + private protected void ValidateSize(Vector3 size) + { + for (int i = 0; i < 3; i++) + { + if (size[i] <= 0) + { + var boundsSize = size; + boundsSize[i] = 0.01f; + size = boundsSize; + } + } + } + + public override void SetProperty(SerializedProperty property, Type fieldType) + { + _previousValue = property.boundsValue; + base.SetProperty(property, fieldType); + + if (_previousValue.size == Vector3.zero) + { + _previousValue.size = Vector3.one / 10f; + SetValueAndApply(_previousValue); + } + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs.meta new file mode 100644 index 0000000..775e4dc --- /dev/null +++ b/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/BoundsBaseHandler.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: cf1af38cb749f054eb8c583c25b645c6 +timeCreated: 1658879902 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs b/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs new file mode 100644 index 0000000..d758855 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs @@ -0,0 +1,132 @@ +using System; +using Better.Commons.EditorAddons.Drawers.Handlers; +using Better.Commons.EditorAddons.Extensions; +using Better.Commons.Runtime.Utility; +using UnityEditor; +using UnityEngine; + +namespace Better.Attributes.EditorAddons.Drawers.Gizmo +{ + public abstract class GizmoHandler : SerializedPropertyHandler + { + private protected SerializedProperty _serializedProperty; + + private protected readonly Quaternion _defaultRotation = Quaternion.identity; + private protected readonly Vector3 _defaultPosition = Vector3.zero; + private Type _fieldType; + + private string _compiledName; + + public bool ShowInSceneView { get; private set; } + + public virtual void SetProperty(SerializedProperty property, Type fieldType) + { + _serializedProperty = property; + _fieldType = fieldType; + _compiledName = GetCompiledName(); + ShowInSceneView = true; + } + + private string GetCompiledName() + { + if (Validate()) + { + if (_serializedProperty.IsArrayElement()) + { + return $"{ObjectNames.NicifyVariableName(_serializedProperty.GetArrayPath())}"; + } + + return _serializedProperty.displayName; + } + + return string.Empty; + } + + public void SetMode(bool value) + { + ShowInSceneView = value; + } + + public abstract void Apply(SceneView sceneView); + + private protected virtual string GetName() + { + return _compiledName; + } + + 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))) + _serializedProperty.vector3Value = (Vector3)value; + else if (_fieldType.IsEquivalentTo(typeof(Bounds))) + _serializedProperty.boundsValue = (Bounds)value; + else if (_fieldType.IsEquivalentTo(typeof(Quaternion))) + _serializedProperty.quaternionValue = (Quaternion)value; + else + DebugUtility.LogException(); + + _serializedProperty.serializedObject.ApplyModifiedProperties(); + } + + private protected virtual void DrawLabel(string value, Vector3 position, Quaternion rotation, SceneView sceneView) + { + var style = new GUIStyle + { + normal = + { + textColor = Color.green + } + }; + + + var vector3 = GetPosition(position, rotation, sceneView); + + Handles.Label(vector3, value, style); + } + + private protected virtual Vector3 GetPosition(Vector3 position, Quaternion rotation, SceneView sceneView) + { + return rotation * (position + Vector3.up * HandleUtility.GetHandleSize(position) + + sceneView.camera.transform.right * 0.2f * HandleUtility.GetHandleSize(position)); + } + } +} \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs.meta b/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs.meta new file mode 100644 index 0000000..592aee4 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Gizmo/BaseHandlers/GizmoHandler.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: db61636d913e6bc4ab6a4ce56dfcd915 +timeCreated: 1658865058 \ No newline at end of file diff --git a/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs b/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs new file mode 100644 index 0000000..cf13697 --- /dev/null +++ b/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs @@ -0,0 +1,128 @@ +using System.Collections.Generic; +using Better.Attributes.Runtime.Gizmo; +using Better.Commons.EditorAddons.Comparers; +using Better.Commons.EditorAddons.Drawers; +using Better.Commons.EditorAddons.Drawers.BehavioredElements; +using Better.Commons.EditorAddons.Drawers.Container; +using Better.Commons.EditorAddons.Extensions; +using Better.Commons.EditorAddons.Utility; +using UnityEditor; +using UnityEngine.UIElements; + +namespace Better.Attributes.EditorAddons.Drawers.Gizmo +{ + [CustomPropertyDrawer(typeof(BaseGizmoAttribute), true)] + public class GizmoDrawer : BasePropertyDrawer + { + public const string Hide = "Hide"; + public const string Show = "Show"; + + private Dictionary> _behavioredElements; + + public GizmoDrawer() + { + EditorApplication.delayCall += DelayCall; + _behavioredElements = new Dictionary>(SerializedPropertyComparer.Instance); + } + + private void DelayCall() + { + EditorApplication.delayCall -= DelayCall; + SceneView.duringSceneGui += OnSceneGUIDelegate; + SceneView.RepaintAll(); + } + + private void OnSceneGUIDelegate(SceneView sceneView) + { + if (sceneView.drawGizmos) + { + ValidationUtility.ValidateCachedProperties(Handlers); + Apply(sceneView); + } + } + + private void Apply(SceneView sceneView) + { + List keysToRemove = null; + 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); + } + } + } + + protected override void Deconstruct() + { + base.Deconstruct(); + SceneView.duringSceneGui -= OnSceneGUIDelegate; + } + + protected override void PopulateContainer(ElementsContainer container) + { + var fieldType = GetFieldOrElementType(); + var serializedProperty = container.SerializedProperty; + + if (!TypeHandlersBinder.IsSupported(fieldType)) + { + container.AddNotSupportedBox(fieldType, Attribute.GetType()); + return; + } + + var handler = GetHandler(serializedProperty); + handler.SetProperty(serializedProperty, fieldType); + + + if (!_behavioredElements.TryGetValue(serializedProperty, out var element)) + { + element = CreateBehavioredElement(serializedProperty); + _behavioredElements.Add(serializedProperty, element); + } + + var text = handler.ShowInSceneView ? Hide : Show; + element.SubElement.text = text; + element.Attach(container.RootElement); + } + + private void OnClicked(ClickEvent clickEvent, SerializedProperty property) + { + var handler = GetHandler(property); + handler.SetMode(!handler.ShowInSceneView); + if (!_behavioredElements.TryGetValue(property, out var element)) + { + element = CreateBehavioredElement(property); + _behavioredElements.Add(property, element); + } + + var text = handler.ShowInSceneView ? Hide : Show; + element.SubElement.text = text; + SceneView.RepaintAll(); + } + + private BehavioredElement