diff --git a/Assets/Editor Toolbox/Editor/Drawers/Toolbox/PropertySelf/ReferencePickerAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/Toolbox/PropertySelf/ReferencePickerAttributeDrawer.cs index 63a7649a..ddd9b404 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/Toolbox/PropertySelf/ReferencePickerAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/Toolbox/PropertySelf/ReferencePickerAttributeDrawer.cs @@ -12,7 +12,7 @@ public class ReferencePickerAttributeDrawer : ToolboxSelfPropertyDrawer targetType; public Comparison Comparer { get; set; } = (t1, t2) => t1.Name.CompareTo(t2.Name); public bool IsOrdered { get; set; } = true; diff --git a/Assets/Editor Toolbox/Editor/Internal/TypeConstraintReference.cs b/Assets/Editor Toolbox/Editor/Internal/TypeConstraintSerializeReference.cs similarity index 73% rename from Assets/Editor Toolbox/Editor/Internal/TypeConstraintReference.cs rename to Assets/Editor Toolbox/Editor/Internal/TypeConstraintSerializeReference.cs index dace68fe..3668c210 100644 --- a/Assets/Editor Toolbox/Editor/Internal/TypeConstraintReference.cs +++ b/Assets/Editor Toolbox/Editor/Internal/TypeConstraintSerializeReference.cs @@ -5,12 +5,14 @@ namespace Toolbox.Editor.Internal { - public class TypeConstraintReference : TypeConstraintContext + /// + /// Dedicated for SerializeReference-based types. + /// + public class TypeConstraintSerializeReference : TypeConstraintContext { - public TypeConstraintReference(Type targetType) : base(targetType) + public TypeConstraintSerializeReference(Type targetType) : base(targetType) { } - public override bool IsSatisfied(Type type) { return base.IsSatisfied(type) && @@ -25,7 +27,7 @@ public override bool IsSatisfied(Type type) public override bool Equals(object other) { - return other is TypeConstraintReference constraint && + return other is TypeConstraintSerializeReference constraint && base.Equals(other) && EqualityComparer.Default.Equals(targetType, constraint.targetType); } diff --git a/Assets/Editor Toolbox/Editor/Internal/TypeConstraintReference.cs.meta b/Assets/Editor Toolbox/Editor/Internal/TypeConstraintSerializeReference.cs.meta similarity index 83% rename from Assets/Editor Toolbox/Editor/Internal/TypeConstraintReference.cs.meta rename to Assets/Editor Toolbox/Editor/Internal/TypeConstraintSerializeReference.cs.meta index 3df95e93..1ed7eb48 100644 --- a/Assets/Editor Toolbox/Editor/Internal/TypeConstraintReference.cs.meta +++ b/Assets/Editor Toolbox/Editor/Internal/TypeConstraintSerializeReference.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7a47d5ab7d6588a4b82a5b97925f44b0 +guid: 31b19ac86e78b784385b3afb582a1488 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Editor Toolbox/Editor/Internal/TypeField.cs b/Assets/Editor Toolbox/Editor/Internal/TypeField.cs index 4705ceba..f6125d7c 100644 --- a/Assets/Editor Toolbox/Editor/Internal/TypeField.cs +++ b/Assets/Editor Toolbox/Editor/Internal/TypeField.cs @@ -37,11 +37,12 @@ private Type RetriveSelectedType(IReadOnlyList types, int selectedIndex, b private void DrawTypeConflictWarning(Rect position) { - const float warningSpace = 18.0f; + const float warningSpace = 20.0f; var warningPosition = position; warningPosition.xMax = position.xMin; warningPosition.xMin -= warningSpace; + warningPosition.y += EditorGUIUtility.standardVerticalSpacing; var warningIcon = EditorGuiUtility.GetHelpIcon(MessageType.Warning); var warningLabel = new GUIContent(warningIcon, "Currently active type is not available from the selection. " + "It may be caused by a conflict between the type filter and cached data."); diff --git a/Assets/Editor Toolbox/Tests/Editor/TypesFilteringTest.cs b/Assets/Editor Toolbox/Tests/Editor/TypesFilteringTest.cs index 5115070c..4bae665a 100644 --- a/Assets/Editor Toolbox/Tests/Editor/TypesFilteringTest.cs +++ b/Assets/Editor Toolbox/Tests/Editor/TypesFilteringTest.cs @@ -139,7 +139,7 @@ public void TestStandardConstraintPass7() [Test] public void TestReferenceConstraintPass1() { - var constraint = new TypeConstraintReference(typeof(Component)); + var constraint = new TypeConstraintSerializeReference(typeof(Component)); var collection = TypeUtilities.GetCollection(constraint); Assert.AreEqual(0, collection.Values.Count); } @@ -147,7 +147,7 @@ public void TestReferenceConstraintPass1() [Test] public void TestReferenceConstraintPass2() { - var constraint = new TypeConstraintReference(typeof(ClassBase)); + var constraint = new TypeConstraintSerializeReference(typeof(ClassBase)); var collection = TypeUtilities.GetCollection(constraint); Assert.IsTrue(collection.Contains(typeof(ClassWithInterface1))); #pragma warning disable CS0612 @@ -161,7 +161,7 @@ public void TestReferenceConstraintPass2() [Test] public void TestReferenceConstraintPass3() { - var constraint = new TypeConstraintReference(typeof(Interface1)); + var constraint = new TypeConstraintSerializeReference(typeof(Interface1)); var collection = TypeUtilities.GetCollection(constraint); Assert.IsTrue(collection.Contains(typeof(ClassWithInterface1))); #pragma warning disable CS0612