17 lines
459 B
C#
17 lines
459 B
C#
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace Utils.Editor
|
|
{
|
|
[CustomPropertyDrawer(typeof(ReadOnlyFieldAttribute))]
|
|
public class ReadOnlyFieldDrawer : PropertyDrawer
|
|
{
|
|
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
|
{
|
|
GUI.enabled = false;
|
|
EditorGUI.PropertyField(position, property, label, true);
|
|
GUI.enabled = true;
|
|
}
|
|
}
|
|
}
|