Example #1
0
        // PUBLIC METHODS: ------------------------------------------------------------------------

        public static void PrepareInstallUpdate()
        {
            if (EditorApplication.isCompiling)
            {
                return;
            }
            if (EditorApplication.isUpdating)
            {
                return;
            }

            EditorApplication.update -= PrepareInstallUpdate;

            Version updateVersion  = Config.GetUpdate().version;
            Version currentVersion = Config.GetCurrent().version;

            if (updateVersion.Equals(Version.NONE))
            {
                return;
            }
            if (!updateVersion.HigherThan(currentVersion))
            {
                return;
            }

            GameCreatorInstallWindow.OpenWindow();
        }
        public static void OpenWindow()
        {
            WINDOW = EditorWindow.GetWindowWithRect <GameCreatorInstallWindow>(
                new Rect(0f, 0f, WINDOW_W, WINDOW_H),
                true, TITLE, true
                );

            WINDOW.Show();
        }
        private void PaintHead()
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            Rect rectCheckUpdates = GUILayoutUtility.GetRect(GC_UPDATES, EditorStyles.toolbarButton);
            bool checkUpdates     = GUI.Toggle(
                rectCheckUpdates,
                this.autoCheckUpdates,
                GC_UPDATES,
                EditorStyles.toolbarButton
                );

            if (checkUpdates != this.autoCheckUpdates)
            {
                this.autoCheckUpdates = checkUpdates;
                EditorPrefs.SetBool(
                    GameCreatorUpdate.KEY_AUTO_CHECK_UPDATES,
                    this.autoCheckUpdates
                    );
            }

            EditorGUI.BeginDisabledGroup(GameCreatorUpdate.CHECKING_UPDATES);

            bool onClickCheckNow = GUILayout.Button(
                GameCreatorUpdate.CHECKING_UPDATES ? GC_CHECKING : GC_CHECKNOW,
                EditorStyles.toolbarButton
                );

            if (onClickCheckNow && !GameCreatorUpdate.CHECKING_UPDATES)
            {
                UpdateHttpRequest.Request(
                    GameCreatorUpdate.GAMECREATOR_BUNDLE,
                    GameCreatorUpdate.OnRetrieveUpdate
                    );
            }

            EditorGUI.EndDisabledGroup();
            GUILayout.FlexibleSpace();

            EditorGUILayout.LabelField(
                string.Format(VERSION, Config.GetCurrent().version),
                this.styleLabelVersion
                );

            if (GUILayout.Button(GC_FORCEINS, EditorStyles.toolbarButton))
            {
                this.Close();
                GameCreatorInstallWindow.OpenWindow();
            }

            EditorGUILayout.EndHorizontal();
        }
 private void OnEnable()
 {
     WINDOW = this;
 }