mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 08:18:49 -05:00
Fix Color32 fields not being drawn in the inspector
This commit is contained in:
parent
90decd5941
commit
9a058da91a
@ -9,6 +9,7 @@ using UnityEngine;
|
||||
[assembly: RegisterTriValueDrawer(typeof(FloatDrawer), TriDrawerOrder.Fallback)]
|
||||
[assembly: RegisterTriValueDrawer(typeof(StringDrawer), TriDrawerOrder.Fallback)]
|
||||
[assembly: RegisterTriValueDrawer(typeof(ColorDrawer), TriDrawerOrder.Fallback)]
|
||||
[assembly: RegisterTriValueDrawer(typeof(Color32Drawer), TriDrawerOrder.Fallback)]
|
||||
[assembly: RegisterTriValueDrawer(typeof(LayerMaskDrawer), TriDrawerOrder.Fallback)]
|
||||
[assembly: RegisterTriValueDrawer(typeof(EnumDrawer<>), TriDrawerOrder.Fallback)]
|
||||
[assembly: RegisterTriValueDrawer(typeof(Vector2Drawer), TriDrawerOrder.Fallback)]
|
||||
@ -57,6 +58,14 @@ namespace TriInspector.Drawers
|
||||
}
|
||||
}
|
||||
|
||||
public class Color32Drawer : BuiltinDrawerBase<Color32>
|
||||
{
|
||||
protected override Color32 OnValueGUI(Rect position, GUIContent label, Color32 value)
|
||||
{
|
||||
return EditorGUI.ColorField(position, label, value);
|
||||
}
|
||||
}
|
||||
|
||||
public class LayerMaskDrawer : BuiltinDrawerBase<LayerMask>
|
||||
{
|
||||
protected override LayerMask OnValueGUI(Rect position, GUIContent label, LayerMask value)
|
||||
|
@ -47,6 +47,7 @@ namespace TriInspector.Utilities
|
||||
type == typeof(Vector3Int) ||
|
||||
type == typeof(Vector4) ||
|
||||
type == typeof(Color) ||
|
||||
type == typeof(Color32) ||
|
||||
type == typeof(LayerMask) ||
|
||||
type == typeof(Rect) ||
|
||||
type == typeof(RectInt) ||
|
||||
|
Loading…
Reference in New Issue
Block a user