canto/Assets/Scripts/Editor/PropertyDrawers/LayerPropertyDrawer.cs
2025-08-16 16:17:16 -04:00

20 lines
511 B
C#

using KitsuneCafe.Sys;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine.UIElements;
namespace KitsuneCafe.Editor
{
[CustomPropertyDrawer(typeof(Layer))]
public class LayerPropertyDrawer : PropertyDrawer
{
public override VisualElement CreatePropertyGUI(SerializedProperty property)
{
var field = new LayerField(ObjectNames.NicifyVariableName(property.name));
field.Bind(property.serializedObject);
field.bindingPath = "index";
return field;
}
}
}