Skip to content

Commit dfb5858

Browse files
committed
Added custom drawers for Color and Animation Curves
1 parent 45ebbf4 commit dfb5858

File tree

4 files changed

+177
-98
lines changed

4 files changed

+177
-98
lines changed

Editor/Utilities/Extensions.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Reflection;
44
using System.Linq;
55
using UnityEditor;
6+
using UnityEngine;
67

78
namespace Lachee.Utilities.Editor
89
{
@@ -15,8 +16,9 @@ public static class SerializedPropertyExtensions
1516
/// <returns></returns>
1617
public static System.Type GetSerializedType(this SerializedProperty property)
1718
{
18-
var fi = property.GetSerializedFieldInfo();
19-
return fi?.FieldType;
19+
var value = property.GetSerializedValue();
20+
if (value != null) return value.GetType();
21+
return property.GetSerializedFieldInfo()?.FieldType;
2022
}
2123

2224
/// <summary>
@@ -191,6 +193,9 @@ public static string GetValueName(this SerializedProperty property)
191193
if (value is float vFloat)
192194
return vFloat.ToString("n3");
193195

196+
if (value is Color vColor)
197+
return vColor.ToHex();
198+
194199
return value.ToString();
195200
}
196201
}

0 commit comments

Comments
 (0)