示例#1
0
        public static void DrawSettings(LogSettingsSO settings)
        {
            if (_drawer == null)
            {
                _drawer = new LogLevelsGUI(settings);
            }

            Debug.Assert(_drawer.settings == settings);
            _drawer.Draw();
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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);
            }
        }
示例#4
0
 public override void OnInspectorGUI()
 {
     CurrentScriptField();
     EditorGUILayout.Space();
     LogLevelsGUI.DrawSettings(target as LogSettingsSO);
 }