Files
Emberwild/Assets/GAME/Script/Editor/LayerAttributeDrawer.cs
T
2026-06-22 16:18:34 +02:00

19 lines
586 B
C#

using UnityEditor;
using UnityEngine;
using Ashwild.Harvesting;
namespace Ashwild.EditorTools
{
[CustomPropertyDrawer(typeof(LayerAttribute))]
public class LayerAttributeDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
if (property.propertyType == SerializedPropertyType.Integer)
property.intValue = EditorGUI.LayerField(position, label, property.intValue);
else
EditorGUI.PropertyField(position, property, label);
}
}
}