void OnGUI() { using (EditorGUILayout.ScrollViewScope scrollScope = new EditorGUILayout.ScrollViewScope(dictionaryScrollPosition, GUIStyle.none, GUI.skin.verticalScrollbar)) { dictionaryScrollPosition = scrollScope.scrollPosition; using (new EditorGUILayout.VerticalScope()) { using (new EditorGUILayout.VerticalScope()) { serializedObject.Update(); EditorGUILayout.PropertyField(settingsProp); serializedObject.ApplyModifiedProperties(); if (settings == null) { LogSettings newSettings = LogLevelsGui.DrawCreateNewButton(); if (newSettings != null) { settingsProp.objectReferenceValue = newSettings; serializedObject.ApplyModifiedProperties(); } } else { LogLevelsGui.DrawLogFactoryDictionary(settings); } } } } }
public override void OnInspectorGUI() { DrawDefaultInspector(); NetworkLogSettings target = this.target as NetworkLogSettings; if (target.settings == null) { LogSettings newSettings = LogLevelsGui.DrawCreateNewButton(); if (newSettings != null) { SerializedProperty settingsProp = serializedObject.FindProperty("settings"); settingsProp.objectReferenceValue = newSettings; serializedObject.ApplyModifiedProperties(); } } else { LogLevelsGui.DrawLogFactoryDictionary(target.settings); } }