Skip to content

Commit 404ced8

Browse files
Updated protected field
1 parent 2a2be52 commit 404ced8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Runtime/Attributes/Protected.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)