File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ public class Protected : UnityEngine.PropertyAttribute { }
77#if UNITY_EDITOR
88 [ UnityEditor . CustomPropertyDrawer ( typeof ( Protected ) ) ]
99 public class ProtectedDrawer : UnityEditor . PropertyDrawer {
10- public override void OnGUI ( UnityEngine . Rect position , UnityEditor . SerializedProperty serializedProperty , UnityEngine . GUIContent label ) { }
11-
12- public override float GetPropertyHeight ( UnityEditor . SerializedProperty property , UnityEngine . GUIContent label ) {
13- // https://forum.unity.com/threads/getpropertyheight-and-arrays.443235/
14- return - 1 ;
10+ public override void OnGUI ( UnityEngine . Rect position , UnityEditor . SerializedProperty serializedProperty , UnityEngine . GUIContent label ) {
11+ var wasEnabled = UnityEngine . GUI . enabled ;
12+ UnityEngine . GUI . enabled = false ;
13+ UnityEditor . EditorGUI . PropertyField ( position , serializedProperty , label ) ;
14+ UnityEngine . GUI . enabled = wasEnabled ;
1515 }
1616 }
1717#endif
You can’t perform that action at this time.
0 commit comments