mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 08:18:49 -05:00
Fix LayerMask drawer
This commit is contained in:
parent
6bbde41299
commit
0e23ca4a42
@ -2,6 +2,7 @@
|
|||||||
using TriInspector;
|
using TriInspector;
|
||||||
using TriInspector.Drawers;
|
using TriInspector.Drawers;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
|
using UnityEditorInternal;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
[assembly: RegisterTriValueDrawer(typeof(IntegerDrawer), TriDrawerOrder.Fallback)]
|
[assembly: RegisterTriValueDrawer(typeof(IntegerDrawer), TriDrawerOrder.Fallback)]
|
||||||
@ -50,6 +51,7 @@ namespace TriInspector.Drawers
|
|||||||
return EditorGUI.IntField(position, label, value);
|
return EditorGUI.IntField(position, label, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LongDrawer : BuiltinDrawerBase<long>
|
public class LongDrawer : BuiltinDrawerBase<long>
|
||||||
{
|
{
|
||||||
protected override long OnValueGUI(Rect position, GUIContent label, long value)
|
protected override long OnValueGUI(Rect position, GUIContent label, long value)
|
||||||
@ -57,6 +59,7 @@ namespace TriInspector.Drawers
|
|||||||
return EditorGUI.LongField(position, label, value);
|
return EditorGUI.LongField(position, label, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FloatDrawer : BuiltinDrawerBase<float>
|
public class FloatDrawer : BuiltinDrawerBase<float>
|
||||||
{
|
{
|
||||||
protected override float OnValueGUI(Rect position, GUIContent label, float value)
|
protected override float OnValueGUI(Rect position, GUIContent label, float value)
|
||||||
@ -85,7 +88,11 @@ namespace TriInspector.Drawers
|
|||||||
{
|
{
|
||||||
protected override LayerMask OnValueGUI(Rect position, GUIContent label, LayerMask value)
|
protected override LayerMask OnValueGUI(Rect position, GUIContent label, LayerMask value)
|
||||||
{
|
{
|
||||||
return EditorGUI.LayerField(position, label, value);
|
var mask = InternalEditorUtility.LayerMaskToConcatenatedLayersMask(value);
|
||||||
|
var layers = InternalEditorUtility.layers;
|
||||||
|
|
||||||
|
position = EditorGUI.PrefixLabel(position, label);
|
||||||
|
return EditorGUI.MaskField(position, mask, layers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user