示例#1
0
        void OnEnable()
        {
            window       = this;
            this.minSize = new Vector2(540, 670);

            headerStyle.fontSize         = 18;
            headerStyle.fontStyle        = FontStyle.Bold;
            headerStyle.normal.textColor = EditorGUIUtility.isProSkin ? proHeadingColor : new Color(0.25f, 0.25f, 0.25f, 1f);
            headerStyle.margin.top       = 10;
            headerStyle.margin.bottom    = 5;

            subHeaderStyle.fontSize         = 14;
            subHeaderStyle.fontStyle        = FontStyle.Bold;
            subHeaderStyle.normal.textColor = EditorGUIUtility.isProSkin ? proHeadingColor : new Color(0.25f, 0.25f, 0.25f, 1f);

            subHeaderStyle.margin.top = 10;

            smallHeadingStyle.fontStyle   = FontStyle.Bold;
            smallHeadingStyle.margin.top  = 5;
            smallHeadingStyle.margin.left = 6;
            if (EditorGUIUtility.isProSkin)
            {
                smallHeadingStyle.normal.textColor = proHeadingColor;
            }

            _windowSettings = EditorFullscreenSettings.LoadSettings();
            EditorFullscreenState.TriggerFullscreenEvent(this, this.GetType(), Vector2.zero, false); //Notify everyone that the settings window was opened.
        }
        private static void Initialize()
        {
            try
            {
                scriptFileSubPath = GetMenuItemScriptFileRelativePath();
                if (scriptFileSubPath == null)
                {
                    return;
                }
                scriptFilePath = Application.dataPath + scriptFileSubPath;

                _settings.LoadSettings();

                if (MenuItemScriptNeedsRefresh())
                {
                    _settings.SaveSettings(false);
                    UpdateMenuItems();
                }
            }
            catch (System.Exception e)
            {
                if (EditorFullscreenState.LogNonFatalErrors)
                {
                    Debug.LogError("Settings failed to load.");
                    Debug.LogException(e);
                }
            }
        }
示例#3
0
 void ResetSettingsToDefaults()
 {
     EditorFullscreenSettings.ResetToDefaults();
     hotkeysWereChanged = true;
     EditorFullscreenSettings.settings.SaveSettings(hotkeysWereChanged);
     _windowSettings    = EditorFullscreenSettings.LoadSettings();
     allowApplySettings = false;
     hotkeysWereChanged = false;
 }