diff --git a/Editor/EditorAddons/Drawers/Base.meta b/Editor/EditorAddons/Drawers/Base.meta
deleted file mode 100644
index 3c0903d..0000000
--- a/Editor/EditorAddons/Drawers/Base.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 14fefd7b45208a0428df150aa6f7530a
-timeCreated: 1663074030
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Base/FieldDrawer.cs b/Editor/EditorAddons/Drawers/Base/FieldDrawer.cs
deleted file mode 100644
index 98176eb..0000000
--- a/Editor/EditorAddons/Drawers/Base/FieldDrawer.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using UnityEditor;
-using UnityEngine;
-
-namespace Better.Attributes.EditorAddons.Drawers.Base
-{
- public abstract class FieldDrawer : PropertyDrawer
- {
- private protected FieldDrawer()
- {
- Selection.selectionChanged += OnSelectionChanged;
- }
-
- ~FieldDrawer()
- {
- Selection.selectionChanged -= OnSelectionChanged;
- Deconstruct();
- }
-
- private void OnSelectionChanged()
- {
- Selection.selectionChanged -= OnSelectionChanged;
- Deconstruct();
- }
-
- private protected abstract void Deconstruct();
-
- ///
- /// Internal method called by Unity
- /// Execution order:
- ///
- /// if(!) -> ->
- ///
- ///
- ///
- ///
- ///
- public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
- {
- if (!PreDraw(ref position, property, label)) return;
-
- DrawField(position, property, label);
-
- PostDraw(position, property, label);
- }
-
- private protected virtual void DrawField(Rect position, SerializedProperty property, GUIContent label)
- {
- var preparePropertyRect = PreparePropertyRect(position);
- EditorGUI.PropertyField(preparePropertyRect, property, label, true);
- }
-
- private protected abstract bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label);
- private protected abstract Rect PreparePropertyRect(Rect original);
- private protected abstract void PostDraw(Rect position, SerializedProperty property, GUIContent label);
- }
-}
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Base/FieldDrawer.cs.meta b/Editor/EditorAddons/Drawers/Base/FieldDrawer.cs.meta
deleted file mode 100644
index bd6b86f..0000000
--- a/Editor/EditorAddons/Drawers/Base/FieldDrawer.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 80a57780bb9ff23448eb9da2bae00a83
-timeCreated: 1663074898
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs b/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs
deleted file mode 100644
index b8ee426..0000000
--- a/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-using System;
-using Better.Attributes.EditorAddons.Drawers.Comparers;
-using Better.Attributes.EditorAddons.Drawers.Utilities;
-using UnityEditor;
-using UnityEngine;
-
-namespace Better.Attributes.EditorAddons.Drawers.Base
-{
- public abstract class MultiFieldDrawer : FieldDrawer where T : UtilityWrapper
- {
- private protected WrapperCollection _wrappers;
-
- ///
- /// Method generates explicit typed collection inherited from
- ///
- ///
- private protected abstract WrapperCollection GenerateCollection();
-
- public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
- {
- _wrappers ??= GenerateCollection();
- base.OnGUI(position, property, label);
- }
-
- private protected virtual Type GetFieldType()
- {
- var type = fieldInfo.FieldType;
- if (type.IsArray)
- {
- return type.GetElementType();
- }
- return type;
- }
-
- ///
- /// Validates if contains property by
- ///
- /// SerializedProperty what will be stored into
- /// used to validate current stored wrappers and gets instance for recently added property
- ///
- /// Returns true if wrapper for was already stored into
- private protected bool ValidateCachedProperties(SerializedProperty property,
- BaseUtility handler) where THandler : new()
- {
- var fieldType = GetFieldType();
- var contains = _wrappers.ContainsKey(property);
- if (contains)
- {
- handler.ValidateCachedProperties(_wrappers);
- }
- else
- {
- var gizmoWrapper = handler.GetUtilityWrapper(fieldType, attribute.GetType());
- _wrappers.Add(property, new WrapperCollectionValue(gizmoWrapper, fieldType));
- }
-
- return contains;
- }
- }
-}
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs.meta b/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs.meta
deleted file mode 100644
index 6fd44c2..0000000
--- a/Editor/EditorAddons/Drawers/Base/MultiFieldDrawer.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: e84ec7387e535494eba1fb184736e949
-timeCreated: 1663378765
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs b/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs
deleted file mode 100644
index f8951d7..0000000
--- a/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.Collections.Generic;
-using Better.Attributes.EditorAddons.Drawers.Comparers;
-using Better.Attributes.EditorAddons.Drawers.Utilities;
-using UnityEditor;
-
-namespace Better.Attributes.EditorAddons.Drawers.Base
-{
- public class WrapperCollection : Dictionary>
- where T : UtilityWrapper
- {
- public WrapperCollection() : base(SerializedPropertyComparer.Instance)
- {
- }
-
- ///
- /// Deconstruct method for stored wrappers
- ///
- public void Deconstruct()
- {
- foreach (var gizmo in Values)
- {
- gizmo.Wrapper.Deconstruct();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs.meta b/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs.meta
deleted file mode 100644
index 5cff979..0000000
--- a/Editor/EditorAddons/Drawers/Base/WrapperCollection.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: fe3ec4b9288f1b546b6fc7e3e8afaed8
-timeCreated: 1663276182
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Base/WrapperCollectionValue.cs b/Editor/EditorAddons/Drawers/Base/WrapperCollectionValue.cs
deleted file mode 100644
index 6595f13..0000000
--- a/Editor/EditorAddons/Drawers/Base/WrapperCollectionValue.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using Better.Attributes.EditorAddons.Drawers.Utilities;
-
-namespace Better.Attributes.EditorAddons.Drawers.Base
-{
- public class WrapperCollectionValue where T : UtilityWrapper
- {
- public WrapperCollectionValue(T wrapper, Type type)
- {
- Wrapper = wrapper;
- Type = type;
- }
-
- public T Wrapper { get; }
- public Type Type { get; }
- }
-}
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Base/WrapperCollectionValue.cs.meta b/Editor/EditorAddons/Drawers/Base/WrapperCollectionValue.cs.meta
deleted file mode 100644
index cc0fdea..0000000
--- a/Editor/EditorAddons/Drawers/Base/WrapperCollectionValue.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 965b30afc55841a598b3d8b34d7240c2
-timeCreated: 1667347161
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs b/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs
deleted file mode 100644
index 34be273..0000000
--- a/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Better.Attributes.EditorAddons.Drawers.Base
-{
- public class WrappersTypeCollection : Dictionary>
- {
- public WrappersTypeCollection() : base()
- {
- }
-
- public WrappersTypeCollection(IEqualityComparer equalityComparer) : base(equalityComparer)
- {
- }
- }
-}
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs.meta b/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs.meta
deleted file mode 100644
index f0d89a6..0000000
--- a/Editor/EditorAddons/Drawers/Base/WrappersTypeCollection.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: a997aa6e54834524a863fb961cf089a8
-timeCreated: 1663104305
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Comparers.meta b/Editor/EditorAddons/Drawers/Comparers.meta
deleted file mode 100644
index 47efe44..0000000
--- a/Editor/EditorAddons/Drawers/Comparers.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 1d634c1409824f2580bd322d02682fad
-timeCreated: 1667349095
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Comparers/AssignableFromComparer.cs b/Editor/EditorAddons/Drawers/Comparers/AssignableFromComparer.cs
deleted file mode 100644
index b23cc6d..0000000
--- a/Editor/EditorAddons/Drawers/Comparers/AssignableFromComparer.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Better.Attributes.EditorAddons.Drawers.Comparers
-{
- public class AssignableFromComparer : BaseComparer, IEqualityComparer
- {
- public bool Equals(Type x, Type y)
- {
- if (ReferenceEquals(x, y)) return true;
- if (ReferenceEquals(x, null)) return false;
- if (ReferenceEquals(y, null)) return false;
- var isAssignableFrom = x.IsAssignableFrom(y);
- return isAssignableFrom || x == y;
- }
-
- public int GetHashCode(Type obj)
- {
- return 0;
- }
- }
-}
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Comparers/AssignableFromComparer.cs.meta b/Editor/EditorAddons/Drawers/Comparers/AssignableFromComparer.cs.meta
deleted file mode 100644
index 59efa58..0000000
--- a/Editor/EditorAddons/Drawers/Comparers/AssignableFromComparer.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: f512f615bc0640f1914a49a2a356c878
-timeCreated: 1667349122
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Comparers/BaseComparer.cs b/Editor/EditorAddons/Drawers/Comparers/BaseComparer.cs
deleted file mode 100644
index cd3966c..0000000
--- a/Editor/EditorAddons/Drawers/Comparers/BaseComparer.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System.Collections.Generic;
-
-namespace Better.Attributes.EditorAddons.Drawers.Comparers
-{
- public abstract class BaseComparer where T : IEqualityComparer, new()
- {
- public static T Instance { get; } = new T();
- }
-}
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Comparers/BaseComparer.cs.meta b/Editor/EditorAddons/Drawers/Comparers/BaseComparer.cs.meta
deleted file mode 100644
index bd6c61c..0000000
--- a/Editor/EditorAddons/Drawers/Comparers/BaseComparer.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 565e62b914374ffcbf1fd257414b8a60
-timeCreated: 1665894675
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Comparers/SerializedPropertyComparer.cs b/Editor/EditorAddons/Drawers/Comparers/SerializedPropertyComparer.cs
deleted file mode 100644
index 76df696..0000000
--- a/Editor/EditorAddons/Drawers/Comparers/SerializedPropertyComparer.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System.Collections.Generic;
-using UnityEditor;
-
-namespace Better.Attributes.EditorAddons.Drawers.Comparers
-{
- public class SerializedPropertyComparer : BaseComparer,
- IEqualityComparer
- {
- public bool Equals(SerializedProperty x, SerializedProperty y)
- {
- if (ReferenceEquals(x, y)) return true;
- if (ReferenceEquals(x, null)) return false;
- if (ReferenceEquals(y, null)) return false;
- if (x.GetType() != y.GetType()) return false;
- return x.propertyPath == y.propertyPath;
- }
-
- public int GetHashCode(SerializedProperty obj)
- {
- return (obj.propertyPath != null ? obj.propertyPath.GetHashCode() : 0);
- }
- }
-}
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Comparers/SerializedPropertyComparer.cs.meta b/Editor/EditorAddons/Drawers/Comparers/SerializedPropertyComparer.cs.meta
deleted file mode 100644
index 53c0464..0000000
--- a/Editor/EditorAddons/Drawers/Comparers/SerializedPropertyComparer.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: e2586f56e13a48328317887bf71284da
-timeCreated: 1667349123
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Comparers/TypeComparer.cs b/Editor/EditorAddons/Drawers/Comparers/TypeComparer.cs
deleted file mode 100644
index 37c3c09..0000000
--- a/Editor/EditorAddons/Drawers/Comparers/TypeComparer.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Better.Attributes.EditorAddons.Drawers.Comparers
-{
- public class TypeComparer : BaseComparer, IEqualityComparer
- {
- public bool Equals(Type x, Type y)
- {
- if (ReferenceEquals(x, y)) return true;
- if (ReferenceEquals(x, null)) return false;
- if (ReferenceEquals(y, null)) return false;
- if (x.IsAssignableFrom(y) || x == y) return true;
- return (y.IsInterface || y.IsAbstract) && x == typeof(Type);
- }
-
- public int GetHashCode(Type obj)
- {
- return 0;
- }
- }
-}
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Comparers/TypeComparer.cs.meta b/Editor/EditorAddons/Drawers/Comparers/TypeComparer.cs.meta
deleted file mode 100644
index 122f929..0000000
--- a/Editor/EditorAddons/Drawers/Comparers/TypeComparer.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 275d5683c4254777bb42ad31b2fd791d
-timeCreated: 1667349122
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs b/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs
index a514bd5..17755af 100644
--- a/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs
+++ b/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorDrawer.cs
@@ -1,8 +1,8 @@
using System;
-using Better.Attributes.EditorAddons.Drawers.Base;
using Better.Attributes.EditorAddons.Drawers.Utilities;
using Better.Attributes.EditorAddons.Drawers.WrapperCollections;
using Better.Attributes.Runtime.DrawInspector;
+using Better.EditorTools.Drawers.Base;
using Better.EditorTools.Helpers;
using UnityEditor;
using UnityEngine;
@@ -15,17 +15,17 @@ public class DrawInspectorDrawer : MultiFieldDrawer
private bool _isOpen;
private DrawInspectors Collection => _wrappers as DrawInspectors;
- private protected override void Deconstruct()
+ protected override void Deconstruct()
{
_wrappers.Deconstruct();
}
- private protected override Type GetFieldType()
+ protected override Type GetFieldType()
{
return fieldInfo.FieldType;
}
- private protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label)
+ protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label)
{
var fieldType = GetFieldType();
if (fieldType.IsArray || !DrawInspectorUtility.Instance.IsSupported(fieldType))
@@ -55,17 +55,17 @@ private protected override bool PreDraw(ref Rect position, SerializedProperty pr
return true;
}
- private protected override Rect PreparePropertyRect(Rect original)
+ protected override Rect PreparePropertyRect(Rect original)
{
return original;
}
- private protected override void PostDraw(Rect position, SerializedProperty property, GUIContent label)
+ protected override void PostDraw(Rect position, SerializedProperty property, GUIContent label)
{
Collection.OnGUI(property);
}
- private protected override WrapperCollection GenerateCollection()
+ protected override WrapperCollection GenerateCollection()
{
return new DrawInspectors();
}
diff --git a/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorWrapper.cs b/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorWrapper.cs
index 8005aa1..b1e5e6a 100644
--- a/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorWrapper.cs
+++ b/Editor/EditorAddons/Drawers/DrawInspector/DrawInspectorWrapper.cs
@@ -1,5 +1,5 @@
using System;
-using Better.Attributes.EditorAddons.Drawers.Utilities;
+using Better.EditorTools.Utilities;
using UnityEditor;
using Object = UnityEngine.Object;
diff --git a/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers/GizmoWrapper.cs b/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers/GizmoWrapper.cs
index edfaa53..d52efff 100644
--- a/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers/GizmoWrapper.cs
+++ b/Editor/EditorAddons/Drawers/Gizmo/BaseWrappers/GizmoWrapper.cs
@@ -1,5 +1,6 @@
using System;
using Better.Attributes.EditorAddons.Drawers.Utilities;
+using Better.EditorTools.Utilities;
using UnityEditor;
using UnityEngine;
#if UNITY_2022_1_OR_NEWER
diff --git a/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs b/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs
index 79dbbc7..06649da 100644
--- a/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs
+++ b/Editor/EditorAddons/Drawers/Gizmo/GizmoDrawer.cs
@@ -1,7 +1,7 @@
-using Better.Attributes.EditorAddons.Drawers.Base;
-using Better.Attributes.EditorAddons.Drawers.WrapperCollections;
+using Better.Attributes.EditorAddons.Drawers.WrapperCollections;
using Better.Attributes.Runtime.Gizmo;
using Better.EditorTools;
+using Better.EditorTools.Drawers.Base;
using Better.EditorTools.Helpers;
using UnityEditor;
using UnityEngine;
@@ -42,13 +42,13 @@ private void OnSceneGUIDelegate(SceneView sceneView)
}
}
- private protected override void Deconstruct()
+ protected override void Deconstruct()
{
SceneView.duringSceneGui -= OnSceneGUIDelegate;
_wrappers?.Deconstruct();
}
- private protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label)
+ protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label)
{
var fieldType = fieldInfo.FieldType;
var attributeType = attribute.GetType();
@@ -81,7 +81,7 @@ private protected override bool PreDraw(ref Rect position, SerializedProperty pr
return true;
}
- private protected override void PostDraw(Rect position, SerializedProperty property, GUIContent label)
+ protected override void PostDraw(Rect position, SerializedProperty property, GUIContent label)
{
if (EditorGUI.EndChangeCheck())
{
@@ -95,12 +95,12 @@ private protected override void PostDraw(Rect position, SerializedProperty prope
}
}
- private protected override WrapperCollection GenerateCollection()
+ protected override WrapperCollection GenerateCollection()
{
return new GizmoWrappers();
}
- private protected override Rect PreparePropertyRect(Rect original)
+ protected override Rect PreparePropertyRect(Rect original)
{
var copy = original;
copy.width *= 0.89f;
diff --git a/Editor/EditorAddons/Drawers/Preview/BaseWrappers/BasePreviewWrapper.cs b/Editor/EditorAddons/Drawers/Preview/BaseWrappers/BasePreviewWrapper.cs
index e518fbe..ebda251 100644
--- a/Editor/EditorAddons/Drawers/Preview/BaseWrappers/BasePreviewWrapper.cs
+++ b/Editor/EditorAddons/Drawers/Preview/BaseWrappers/BasePreviewWrapper.cs
@@ -1,5 +1,5 @@
-using Better.Attributes.EditorAddons.Drawers.Utilities;
-using Better.EditorTools.Helpers;
+using Better.EditorTools.Helpers;
+using Better.EditorTools.Utilities;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
diff --git a/Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs b/Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs
index 8ac1ce8..042d036 100644
--- a/Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs
+++ b/Editor/EditorAddons/Drawers/Preview/PreviewDrawer.cs
@@ -1,7 +1,7 @@
-using Better.Attributes.EditorAddons.Drawers.Base;
-using Better.Attributes.EditorAddons.Drawers.Utilities;
+using Better.Attributes.EditorAddons.Drawers.Utilities;
using Better.Attributes.EditorAddons.Drawers.WrapperCollections;
using Better.Attributes.Runtime.Preview;
+using Better.EditorTools.Drawers.Base;
using Better.EditorTools.Helpers;
using UnityEditor;
using UnityEngine;
@@ -15,12 +15,12 @@ public class PreviewDrawer : MultiFieldDrawer
private float _previewSize;
public PreviewWrappers Collection => _wrappers as PreviewWrappers;
- private protected override void Deconstruct()
+ protected override void Deconstruct()
{
_wrappers.Deconstruct();
}
- private protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label)
+ protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label)
{
var fieldType = fieldInfo.FieldType;
var attributeType = attribute.GetType();
@@ -43,12 +43,12 @@ private protected override bool PreDraw(ref Rect position, SerializedProperty pr
return true;
}
- private protected override Rect PreparePropertyRect(Rect original)
+ protected override Rect PreparePropertyRect(Rect original)
{
return original;
}
- private protected override void PostDraw(Rect position, SerializedProperty property, GUIContent label)
+ protected override void PostDraw(Rect position, SerializedProperty property, GUIContent label)
{
_objectChanged = EditorGUI.EndChangeCheck();
}
@@ -58,7 +58,7 @@ public override float GetPropertyHeight(SerializedProperty property, GUIContent
return EditorGUI.GetPropertyHeight(property, true);
}
- private protected override WrapperCollection GenerateCollection()
+ protected override WrapperCollection GenerateCollection()
{
return new PreviewWrappers();
}
diff --git a/Editor/EditorAddons/Drawers/ReadOnly/ReadOnlyFieldDrawer.cs b/Editor/EditorAddons/Drawers/ReadOnly/ReadOnlyFieldDrawer.cs
index e095ec0..98f08c0 100644
--- a/Editor/EditorAddons/Drawers/ReadOnly/ReadOnlyFieldDrawer.cs
+++ b/Editor/EditorAddons/Drawers/ReadOnly/ReadOnlyFieldDrawer.cs
@@ -1,5 +1,5 @@
-using Better.Attributes.EditorAddons.Drawers.Base;
-using Better.Attributes.Runtime.ReadOnly;
+using Better.Attributes.Runtime.ReadOnly;
+using Better.EditorTools.Drawers.Base;
using UnityEditor;
using UnityEngine;
@@ -8,22 +8,22 @@ namespace Better.Attributes.EditorAddons.Drawers.ReadOnly
[CustomPropertyDrawer(typeof(ReadOnlyFieldAttribute))]
public class ReadOnlyFieldDrawer : FieldDrawer
{
- private protected override void Deconstruct()
+ protected override void Deconstruct()
{
}
- private protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label)
+ protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.BeginDisabledGroup(true);
return true;
}
- private protected override Rect PreparePropertyRect(Rect position)
+ protected override Rect PreparePropertyRect(Rect position)
{
return position;
}
- private protected override void PostDraw(Rect position, SerializedProperty property, GUIContent label)
+ protected override void PostDraw(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.EndDisabledGroup();
}
diff --git a/Editor/EditorAddons/Drawers/Rename/RenameFieldDrawer.cs b/Editor/EditorAddons/Drawers/Rename/RenameFieldDrawer.cs
index d918297..d646137 100644
--- a/Editor/EditorAddons/Drawers/Rename/RenameFieldDrawer.cs
+++ b/Editor/EditorAddons/Drawers/Rename/RenameFieldDrawer.cs
@@ -1,5 +1,5 @@
-using Better.Attributes.EditorAddons.Drawers.Base;
-using Better.Attributes.Runtime.Rename;
+using Better.Attributes.Runtime.Rename;
+using Better.EditorTools.Drawers.Base;
using UnityEditor;
using UnityEngine;
@@ -8,23 +8,23 @@ namespace Better.Attributes.EditorAddons.Drawers.Rename
[CustomPropertyDrawer(typeof(RenameFieldAttribute))]
public class RenameFieldDrawer : FieldDrawer
{
- private protected override void Deconstruct()
+ protected override void Deconstruct()
{
}
- private protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label)
+ protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label)
{
var rename = (attribute as RenameFieldAttribute)?.Name;
label.text = rename;
return true;
}
- private protected override Rect PreparePropertyRect(Rect original)
+ protected override Rect PreparePropertyRect(Rect original)
{
return original;
}
- private protected override void PostDraw(Rect position, SerializedProperty property, GUIContent label)
+ protected override void PostDraw(Rect position, SerializedProperty property, GUIContent label)
{
}
}
diff --git a/Editor/EditorAddons/Drawers/Select/BaseSelectTypeDrawer.cs b/Editor/EditorAddons/Drawers/Select/BaseSelectTypeDrawer.cs
index d0c35c5..22f4984 100644
--- a/Editor/EditorAddons/Drawers/Select/BaseSelectTypeDrawer.cs
+++ b/Editor/EditorAddons/Drawers/Select/BaseSelectTypeDrawer.cs
@@ -1,11 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Reflection;
-using Better.Attributes.EditorAddons.Drawers.Base;
using Better.Attributes.EditorAddons.Drawers.Select.Wrappers;
using Better.Attributes.EditorAddons.Drawers.WrapperCollections;
using Better.Attributes.Runtime.Select;
+using Better.EditorTools.Drawers.Base;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
@@ -19,7 +18,7 @@ public abstract class BaseSelectTypeDrawer : SelectDrawerBase _wrappers as SelectTypeWrappers;
- private protected override WrapperCollection GenerateCollection()
+ protected override WrapperCollection GenerateCollection()
{
return new SelectTypeWrappers();
}
diff --git a/Editor/EditorAddons/Drawers/Select/SelectDrawerBase.cs b/Editor/EditorAddons/Drawers/Select/SelectDrawerBase.cs
index 82dc15b..078723a 100644
--- a/Editor/EditorAddons/Drawers/Select/SelectDrawerBase.cs
+++ b/Editor/EditorAddons/Drawers/Select/SelectDrawerBase.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
-using Better.Attributes.EditorAddons.Drawers.Base;
using Better.Attributes.EditorAddons.Drawers.Select.Wrappers;
using Better.Attributes.EditorAddons.Drawers.Utilities;
using Better.Attributes.Runtime.Select;
+using Better.EditorTools.Drawers.Base;
using Better.EditorTools.Helpers;
using Better.EditorTools.Helpers.DropDown;
using UnityEditor;
@@ -26,12 +26,12 @@ public override float GetPropertyHeight(SerializedProperty property, GUIContent
return EditorGUI.GetPropertyHeight(property, true);
}
- private protected override Type GetFieldType()
+ protected override Type GetFieldType()
{
return (attribute as SelectAttributeBase)?.GetFieldType() ?? base.GetFieldType();
}
- private protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label)
+ protected override bool PreDraw(ref Rect position, SerializedProperty property, GUIContent label)
{
try
{
@@ -86,7 +86,7 @@ private Rect GetPopupPosition(Rect currentPosition)
return popupPosition;
}
- private protected override void Deconstruct()
+ protected override void Deconstruct()
{
DropdownWindow.CloseInstance();
_wrappers?.Deconstruct();
@@ -166,12 +166,12 @@ private void SetReady()
_isSetUp = true;
}
- private protected override Rect PreparePropertyRect(Rect original)
+ protected override Rect PreparePropertyRect(Rect original)
{
return original;
}
- private protected override void PostDraw(Rect position, SerializedProperty property, GUIContent label)
+ protected override void PostDraw(Rect position, SerializedProperty property, GUIContent label)
{
}
}
diff --git a/Editor/EditorAddons/Drawers/Select/SelectEnumDrawer.cs b/Editor/EditorAddons/Drawers/Select/SelectEnumDrawer.cs
index 25f9254..743df54 100644
--- a/Editor/EditorAddons/Drawers/Select/SelectEnumDrawer.cs
+++ b/Editor/EditorAddons/Drawers/Select/SelectEnumDrawer.cs
@@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
-using Better.Attributes.EditorAddons.Drawers.Base;
using Better.Attributes.EditorAddons.Drawers.Select.Wrappers;
using Better.Attributes.EditorAddons.Drawers.WrapperCollections;
using Better.Attributes.Runtime.Select;
+using Better.EditorTools.Drawers.Base;
using Better.Extensions.Runtime;
using UnityEditor;
using UnityEngine;
@@ -37,12 +37,12 @@ public PredefinedValues(string name, int value)
public int Value { get; }
}
- private protected override WrapperCollection GenerateCollection()
+ protected override WrapperCollection GenerateCollection()
{
return new SelectEnumWrappers();
}
- private protected override void DrawField(Rect position, SerializedProperty property, GUIContent label)
+ protected override void DrawField(Rect position, SerializedProperty property, GUIContent label)
{
var preparePropertyRect = PreparePropertyRect(position);
EditorGUI.LabelField(preparePropertyRect, label, EditorStyles.label);
diff --git a/Editor/EditorAddons/Drawers/Select/SelectedItem.cs b/Editor/EditorAddons/Drawers/Select/SelectedItem.cs
index c7db3dd..2dca73a 100644
--- a/Editor/EditorAddons/Drawers/Select/SelectedItem.cs
+++ b/Editor/EditorAddons/Drawers/Select/SelectedItem.cs
@@ -1,4 +1,4 @@
-using Better.Attributes.EditorAddons.Drawers.Comparers;
+using Better.EditorTools.Comparers;
using UnityEditor;
namespace Better.Attributes.EditorAddons.Drawers.Select
diff --git a/Editor/EditorAddons/Drawers/Select/Wrappers/BaseSelectWrapper.cs b/Editor/EditorAddons/Drawers/Select/Wrappers/BaseSelectWrapper.cs
index 6c3f9e2..9bcba54 100644
--- a/Editor/EditorAddons/Drawers/Select/Wrappers/BaseSelectWrapper.cs
+++ b/Editor/EditorAddons/Drawers/Select/Wrappers/BaseSelectWrapper.cs
@@ -1,4 +1,4 @@
-using Better.Attributes.EditorAddons.Drawers.Utilities;
+using Better.EditorTools.Utilities;
using UnityEditor;
namespace Better.Attributes.EditorAddons.Drawers.Select.Wrappers
diff --git a/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs b/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs
deleted file mode 100644
index fe1f022..0000000
--- a/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Better.Attributes.EditorAddons.Drawers.Base;
-
-namespace Better.Attributes.EditorAddons.Drawers.Utilities
-{
- public abstract class UtilityWrapper
- {
- public abstract void Deconstruct();
- }
-
- public abstract class BaseUtility where THandler : new()
- {
- private static THandler _instance;
-
- private protected HashSet _availableTypes;
- private protected WrappersTypeCollection _gizmoWrappersCollection;
-
- public static THandler Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new THandler();
- }
-
- return _instance;
- }
- }
-
- private protected BaseUtility()
- {
- Construct();
- }
-
- private void Construct()
- {
- _gizmoWrappersCollection = GenerateCollection();
- _availableTypes = GenerateAvailable();
- }
-
- private protected Dictionary GetWrapperDictionary(Type type)
- {
- if (_gizmoWrappersCollection.TryGetValue(type, out var dictionary))
- {
- return dictionary;
- }
-
- throw new KeyNotFoundException($"Supported types not found for {type}");
- }
-
- ///
- /// Validates stored properties if their supported
- ///
- ///
- ///
- public void ValidateCachedProperties(WrapperCollection gizmoWrappers) where T : UtilityWrapper
- {
- foreach (var value in gizmoWrappers)
- {
- if (!IsSupported(value.Value.Type))
- {
- gizmoWrappers.Remove(value.Key);
- }
- }
- }
-
- ///
- /// Type collection for .
- /// Example:
- ///
- /// return new WrappersTypeCollection()
- /// {
- /// {
- /// typeof(SupportedAttributeType), new ()
- /// {
- /// { typeof(SupportedType), typeof(WrapperForSupportedType) },
- /// { typeof(SupportedType2), typeof(WrapperForSupportedType2) }
- /// }
- /// }
- /// };
- ///
- ///
- ///
- ///
- ///
- private protected abstract WrappersTypeCollection GenerateCollection();
-
- ///
- /// Types collection for checks
- /// Example:
- ///
- /// return new HashSet(BaseComparer.Instance)
- /// {
- /// typeof(SupportedType),
- /// typeof(SupportedType2)
- /// };
- ///
- ///
- ///
- ///
- ///
- private protected abstract HashSet GenerateAvailable();
-
- ///
- /// Generate ready to use wrapper's instance by dictionary from
- ///
- ///
- ///
- ///
- ///
- public T GetUtilityWrapper(Type type, Type attributeType) where T : UtilityWrapper
- {
- if (!IsSupported(type))
- {
- return null;
- }
-
- var gizmoWrappers = GetWrapperDictionary(attributeType);
- var wrapperType = gizmoWrappers[type];
-
- return (T)Activator.CreateInstance(wrapperType);
- }
-
- ///
- /// Checks if type available in utility
- ///
- ///
- ///
- ///
- public virtual bool IsSupported(Type type)
- {
- return _availableTypes.Contains(type);
- }
- }
-}
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs.meta b/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs.meta
deleted file mode 100644
index 63b5fc9..0000000
--- a/Editor/EditorAddons/Drawers/Utilities/BaseUtility.cs.meta
+++ /dev/null
@@ -1,3 +0,0 @@
-fileFormatVersion: 2
-guid: 330ff3f0836a920478ae356abe6138f9
-timeCreated: 1663078936
\ No newline at end of file
diff --git a/Editor/EditorAddons/Drawers/Utilities/DrawInspectorUtility.cs b/Editor/EditorAddons/Drawers/Utilities/DrawInspectorUtility.cs
index e8a20b5..8bec0ed 100644
--- a/Editor/EditorAddons/Drawers/Utilities/DrawInspectorUtility.cs
+++ b/Editor/EditorAddons/Drawers/Utilities/DrawInspectorUtility.cs
@@ -1,16 +1,17 @@
using System;
using System.Collections.Generic;
-using Better.Attributes.EditorAddons.Drawers.Base;
-using Better.Attributes.EditorAddons.Drawers.Comparers;
using Better.Attributes.EditorAddons.Drawers.DrawInspector;
using Better.Attributes.Runtime.DrawInspector;
+using Better.EditorTools.Comparers;
+using Better.EditorTools.Drawers.Base;
+using Better.EditorTools.Utilities;
using Object = UnityEngine.Object;
namespace Better.Attributes.EditorAddons.Drawers.Utilities
{
public class DrawInspectorUtility : BaseUtility
{
- private protected override WrappersTypeCollection GenerateCollection()
+ protected override WrappersTypeCollection GenerateCollection()
{
return new WrappersTypeCollection()
{
@@ -21,7 +22,7 @@ private protected override WrappersTypeCollection GenerateCollection()
};
}
- private protected override HashSet GenerateAvailable()
+ protected override HashSet GenerateAvailable()
{
return new HashSet(AssignableFromComparer.Instance) { typeof(Object) };
}
diff --git a/Editor/EditorAddons/Drawers/Utilities/GizmoUtility.cs b/Editor/EditorAddons/Drawers/Utilities/GizmoUtility.cs
index d4699e6..dd6680d 100644
--- a/Editor/EditorAddons/Drawers/Utilities/GizmoUtility.cs
+++ b/Editor/EditorAddons/Drawers/Utilities/GizmoUtility.cs
@@ -1,8 +1,9 @@
using System;
using System.Collections.Generic;
-using Better.Attributes.EditorAddons.Drawers.Base;
using Better.Attributes.EditorAddons.Drawers.Gizmo;
using Better.Attributes.Runtime.Gizmo;
+using Better.EditorTools.Drawers.Base;
+using Better.EditorTools.Utilities;
using UnityEditor.Callbacks;
using UnityEngine;
@@ -46,7 +47,7 @@ public void RemoveButtonDrawn(Type type)
}
}
- private protected override WrappersTypeCollection GenerateCollection()
+ protected override WrappersTypeCollection GenerateCollection()
{
return new WrappersTypeCollection()
{
@@ -71,7 +72,7 @@ private protected override WrappersTypeCollection GenerateCollection()
};
}
- private protected override HashSet GenerateAvailable()
+ protected override HashSet GenerateAvailable()
{
return new HashSet()
{
diff --git a/Editor/EditorAddons/Drawers/Utilities/PreviewUtility.cs b/Editor/EditorAddons/Drawers/Utilities/PreviewUtility.cs
index 366af2e..194491a 100644
--- a/Editor/EditorAddons/Drawers/Utilities/PreviewUtility.cs
+++ b/Editor/EditorAddons/Drawers/Utilities/PreviewUtility.cs
@@ -1,16 +1,17 @@
using System;
using System.Collections.Generic;
-using Better.Attributes.EditorAddons.Drawers.Base;
-using Better.Attributes.EditorAddons.Drawers.Comparers;
using Better.Attributes.EditorAddons.Drawers.Preview;
using Better.Attributes.Runtime.Preview;
+using Better.EditorTools.Comparers;
+using Better.EditorTools.Drawers.Base;
+using Better.EditorTools.Utilities;
using UnityEngine;
namespace Better.Attributes.EditorAddons.Drawers.Utilities
{
public class PreviewUtility : BaseUtility
{
- private protected override WrappersTypeCollection GenerateCollection()
+ protected override WrappersTypeCollection GenerateCollection()
{
return new WrappersTypeCollection()
{
@@ -25,7 +26,7 @@ private protected override WrappersTypeCollection GenerateCollection()
};
}
- private protected override HashSet GenerateAvailable()
+ protected override HashSet GenerateAvailable()
{
return new HashSet(AssignableFromComparer.Instance)
{
diff --git a/Editor/EditorAddons/Drawers/Utilities/SelectUtility.cs b/Editor/EditorAddons/Drawers/Utilities/SelectUtility.cs
index 07a7975..1e0c52e 100644
--- a/Editor/EditorAddons/Drawers/Utilities/SelectUtility.cs
+++ b/Editor/EditorAddons/Drawers/Utilities/SelectUtility.cs
@@ -1,15 +1,16 @@
using System;
using System.Collections.Generic;
-using Better.Attributes.EditorAddons.Drawers.Base;
-using Better.Attributes.EditorAddons.Drawers.Comparers;
using Better.Attributes.EditorAddons.Drawers.Select.Wrappers;
using Better.Attributes.Runtime.Select;
+using Better.EditorTools.Comparers;
+using Better.EditorTools.Drawers.Base;
+using Better.EditorTools.Utilities;
namespace Better.Attributes.EditorAddons.Drawers.Utilities
{
public class SelectUtility : BaseUtility
{
- private protected override WrappersTypeCollection GenerateCollection()
+ protected override WrappersTypeCollection GenerateCollection()
{
return new WrappersTypeCollection(TypeComparer.Instance)
{
@@ -28,7 +29,7 @@ private protected override WrappersTypeCollection GenerateCollection()
};
}
- private protected override HashSet GenerateAvailable()
+ protected override HashSet GenerateAvailable()
{
return new HashSet(TypeComparer.Instance)
{
diff --git a/Editor/EditorAddons/Drawers/WrapperCollections/DrawInspectors.cs b/Editor/EditorAddons/Drawers/WrapperCollections/DrawInspectors.cs
index f58fc33..ae80826 100644
--- a/Editor/EditorAddons/Drawers/WrapperCollections/DrawInspectors.cs
+++ b/Editor/EditorAddons/Drawers/WrapperCollections/DrawInspectors.cs
@@ -1,5 +1,5 @@
-using Better.Attributes.EditorAddons.Drawers.Base;
-using Better.Attributes.EditorAddons.Drawers.DrawInspector;
+using Better.Attributes.EditorAddons.Drawers.DrawInspector;
+using Better.EditorTools.Drawers.Base;
using UnityEditor;
namespace Better.Attributes.EditorAddons.Drawers.WrapperCollections
diff --git a/Editor/EditorAddons/Drawers/WrapperCollections/GizmoWrappers.cs b/Editor/EditorAddons/Drawers/WrapperCollections/GizmoWrappers.cs
index 3fd8a7e..bf9a43d 100644
--- a/Editor/EditorAddons/Drawers/WrapperCollections/GizmoWrappers.cs
+++ b/Editor/EditorAddons/Drawers/WrapperCollections/GizmoWrappers.cs
@@ -1,6 +1,6 @@
using System;
-using Better.Attributes.EditorAddons.Drawers.Base;
using Better.Attributes.EditorAddons.Drawers.Gizmo;
+using Better.EditorTools.Drawers.Base;
using UnityEditor;
namespace Better.Attributes.EditorAddons.Drawers.WrapperCollections
diff --git a/Editor/EditorAddons/Drawers/WrapperCollections/PreviewWrappers.cs b/Editor/EditorAddons/Drawers/WrapperCollections/PreviewWrappers.cs
index ce84bf1..d60a497 100644
--- a/Editor/EditorAddons/Drawers/WrapperCollections/PreviewWrappers.cs
+++ b/Editor/EditorAddons/Drawers/WrapperCollections/PreviewWrappers.cs
@@ -1,5 +1,5 @@
-using Better.Attributes.EditorAddons.Drawers.Base;
-using Better.Attributes.EditorAddons.Drawers.Preview;
+using Better.Attributes.EditorAddons.Drawers.Preview;
+using Better.EditorTools.Drawers.Base;
using UnityEditor;
using UnityEngine;
diff --git a/Editor/EditorAddons/Drawers/WrapperCollections/SelectEnumWrappers.cs b/Editor/EditorAddons/Drawers/WrapperCollections/SelectEnumWrappers.cs
index 60a0f9a..86f91a2 100644
--- a/Editor/EditorAddons/Drawers/WrapperCollections/SelectEnumWrappers.cs
+++ b/Editor/EditorAddons/Drawers/WrapperCollections/SelectEnumWrappers.cs
@@ -1,6 +1,6 @@
using System;
-using Better.Attributes.EditorAddons.Drawers.Base;
using Better.Attributes.EditorAddons.Drawers.Select.Wrappers;
+using Better.EditorTools.Drawers.Base;
using UnityEditor;
namespace Better.Attributes.EditorAddons.Drawers.WrapperCollections
diff --git a/Editor/EditorAddons/Drawers/WrapperCollections/SelectTypeWrappers.cs b/Editor/EditorAddons/Drawers/WrapperCollections/SelectTypeWrappers.cs
index 156829a..5bd6bb3 100644
--- a/Editor/EditorAddons/Drawers/WrapperCollections/SelectTypeWrappers.cs
+++ b/Editor/EditorAddons/Drawers/WrapperCollections/SelectTypeWrappers.cs
@@ -1,6 +1,6 @@
using System;
-using Better.Attributes.EditorAddons.Drawers.Base;
using Better.Attributes.EditorAddons.Drawers.Select.Wrappers;
+using Better.EditorTools.Drawers.Base;
using UnityEditor;
namespace Better.Attributes.EditorAddons.Drawers.WrapperCollections
diff --git a/Samples~/TestSamples/Scripts/Test.cs b/Samples~/TestSamples/Scripts/Test.cs
index 2e65f41..000f3c4 100644
--- a/Samples~/TestSamples/Scripts/Test.cs
+++ b/Samples~/TestSamples/Scripts/Test.cs
@@ -29,7 +29,7 @@ public class Test : MonoBehaviour
[SelectEnum] [SerializeField] private MyFlagEnum myFlagEnumTest;
- [DrawInspector] [SerializeField] private PreviewTest component;
+ [Preview] [SerializeField] private PreviewTest component;
[Preview] [SerializeField] private Texture2D texture;
[DrawInspector] [SerializeField] private List scriptableObjectList;
diff --git a/package.json b/package.json
index 584830d..6a17fb1 100644
--- a/package.json
+++ b/package.json
@@ -1,12 +1,12 @@
{
"name": "com.uurha.betterattributes",
"displayName": "Better Attributes",
- "version": "1.5.3",
+ "version": "1.6.0",
"unity": "2018.3",
"description": "Unity attributes, allows to serialize interfaces, draw handles for Vector3/Vector2/Quaternion/Bounds, create read only fields.",
"dependencies": {
"com.uurha.betterextensions": "0.2.8",
- "com.uurha.bettereditortools" : "0.0.4"
+ "com.uurha.bettereditortools" : "0.1.2"
},
"author": {
"name": "Arcueid D'athemon",