mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 08:18:49 -05:00
Fix enum drawer for tri-serialized fields
This commit is contained in:
parent
0be27a96e0
commit
90decd5941
@ -10,7 +10,7 @@ using UnityEngine;
|
||||
[assembly: RegisterTriValueDrawer(typeof(StringDrawer), TriDrawerOrder.Fallback)]
|
||||
[assembly: RegisterTriValueDrawer(typeof(ColorDrawer), TriDrawerOrder.Fallback)]
|
||||
[assembly: RegisterTriValueDrawer(typeof(LayerMaskDrawer), TriDrawerOrder.Fallback)]
|
||||
[assembly: RegisterTriValueDrawer(typeof(EnumDrawer), TriDrawerOrder.Fallback)]
|
||||
[assembly: RegisterTriValueDrawer(typeof(EnumDrawer<>), TriDrawerOrder.Fallback)]
|
||||
[assembly: RegisterTriValueDrawer(typeof(Vector2Drawer), TriDrawerOrder.Fallback)]
|
||||
[assembly: RegisterTriValueDrawer(typeof(Vector3Drawer), TriDrawerOrder.Fallback)]
|
||||
[assembly: RegisterTriValueDrawer(typeof(Vector4Drawer), TriDrawerOrder.Fallback)]
|
||||
@ -65,11 +65,11 @@ namespace TriInspector.Drawers
|
||||
}
|
||||
}
|
||||
|
||||
public class EnumDrawer : BuiltinDrawerBase<Enum>
|
||||
public class EnumDrawer<T> : BuiltinDrawerBase<T> where T : Enum
|
||||
{
|
||||
protected override Enum OnValueGUI(Rect position, GUIContent label, Enum value)
|
||||
protected override T OnValueGUI(Rect position, GUIContent label, T value)
|
||||
{
|
||||
return EditorGUI.EnumPopup(position, label, value);
|
||||
return (T) EditorGUI.EnumPopup(position, label, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user