19 lines
586 B
C#
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);
|
|
}
|
|
}
|
|
}
|