void DrawProperty(HideableProperty property) { EditorGUILayout.BeginVertical(GUI.skin.box); property.show = EditorGUILayout.Toggle("Set " + TypeDisplayName, property.show); if (property.show) { EditorGUILayout.PropertyField(property.property, GUIContent.none); } else { property.property.objectReferenceValue = null; } EditorGUILayout.EndVertical(); }
void OnEnable() { profile = new HideableProperty(serializedObject.FindProperty("profile")); }