using UnityEditor; using UnityEngine; namespace Funique { [CustomPropertyDrawer(typeof(Disable))] public class DisableDrawer : IfDrawerBase { public override void OnGUI(Rect position, SerializedProperty p, GUIContent label) { GUI.enabled = false; EditorGUI.PropertyField(position, p, label, true); GUI.enabled = true; } public override float GetPropertyHeight(SerializedProperty p, GUIContent label) { return EditorGUI.GetPropertyHeight(p, true); } } }