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); } } } } }
void OnGUI() { EditorGUILayout.BeginVertical(); EditorGUILayout.Space(); EditorGUILayout.LabelField(new GUIContent("Mirror Log Levels"), EditorStyles.boldLabel); EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins); 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); } EditorGUILayout.EndVertical(); }
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); } }
public override void OnInspectorGUI() { CurrentScriptField(); LogLevelsGUI.DrawLogFactoryDictionary(target as LogSettings); }