public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { var height = EditorGUIUtility.singleLineHeight; position.height = height; _first = position; _current = position; var row1 = position; EditorGUI.PropertyField(row1, property, new GUIContent("Project Settings"), includeChildren: false); if (property.isExpanded) { EditorGUI.indentLevel++; var overrideProp = property.FindPropertyRelative("OverrideProfile"); var profileProp = property.FindPropertyRelative("ProfileToApply"); EditorGUI.PropertyField(NextRow(width: position.width * 0.9f), overrideProp); var useProfile = overrideProp.boolValue; if (GUI.changed && !useProfile) { profileProp.objectReferenceValue = null; } if (useProfile) { if (GUI.changed) { profileProp.objectReferenceValue = SettingsUtils.CreateProfile(); SettingsUtils.CopyProjectSettingsToProfile(); } EditorGUI.PropertyField(NextRow(width: position.width * 0.9f), profileProp, includeChildren: false); if (profileProp.objectReferenceValue == null && SettingsUtils.HasFile) { if (GUI.Button(NextColumn(expand: true), new GUIContent("Find"))) { var profile = Resources.Load <ExperienceProfile>("LimappConfig"); profileProp.objectReferenceValue = profile; } } else if (profileProp.objectReferenceValue == null) { if (GUI.Button(NextColumn(expand: true), new GUIContent("Add"))) { SettingsUtils.CreateProfile(); var profile = AssetDatabase.LoadAssetAtPath <ExperienceProfile>( $"{SDKResourcesConsts.LiminalSettingsConfigPath}"); profileProp.objectReferenceValue = profile; } } else { if (GUI.Button(NextColumn(expand: true), new GUIContent("X"))) { profileProp.objectReferenceValue = null; } } } EditorGUI.indentLevel--; } }