public static void DrawSettings(LogSettingsSO settings) { if (_drawer == null) { _drawer = new LogLevelsGUI(settings); } Debug.Assert(_drawer.settings == settings); _drawer.Draw(); }
public override void OnGUI(string searchContext) { // look for existing settings first if (settings == null) { settings = EditorLogSettingsLoader.FindLogSettings(); } // then draw field settings = (LogSettingsSO)EditorGUILayout.ObjectField("Settings", settings, typeof(LogSettingsSO), false); // then draw rest of ui if (settings == null) { settings = LogLevelsGUI.DrawCreateNewButton(); } else { LogLevelsGUI.DrawSettings(settings); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); var target = this.target as LogSettings; if (target._settings == null) { var newSettings = LogLevelsGUI.DrawCreateNewButton(); if (newSettings != null) { var settingsProp = serializedObject.FindProperty("settings"); settingsProp.objectReferenceValue = newSettings; serializedObject.ApplyModifiedProperties(); } } else { LogLevelsGUI.DrawSettings(target._settings); } }
public override void OnInspectorGUI() { CurrentScriptField(); EditorGUILayout.Space(); LogLevelsGUI.DrawSettings(target as LogSettingsSO); }