Пример #1
0
        private void PaintGUI()
        {
            GUILayout.Space(WINDOW_P);
            GUILayout.FlexibleSpace();

            Rect rectLogoTotal = GUILayoutUtility.GetRect(WINDOW_W, LOGO_SIZE);
            Rect rectLogo      = new Rect(
                rectLogoTotal.x + (rectLogoTotal.width / 2f - LOGO_SIZE / 2f),
                rectLogoTotal.y,
                LOGO_SIZE,
                LOGO_SIZE
                );

            GUI.DrawTexture(rectLogo, this.textureLogo);
            GUILayout.Space(WINDOW_P);
            GUILayout.FlexibleSpace();
            GUILayout.Space(WINDOW_P);

            GameCreatorInstall.Requirement requirement = GameCreatorInstall.MeetsUnityRequirements();

            if (!requirement.success)
            {
                EditorGUILayout.HelpBox(
                    requirement.message,
                    MessageType.Error
                    );
            }
            else if (!string.IsNullOrEmpty(requirement.message))
            {
                EditorGUILayout.HelpBox(
                    requirement.message,
                    MessageType.Warning
                    );
            }

            Rect rectButton = GUILayoutUtility.GetRect(WINDOW_W, 50f);

            rectButton.x     += WINDOW_P;
            rectButton.width -= (WINDOW_P * 2f);

            string contButton = string.Format(MSG_BUTTON, Config.GetUpdate().version);

            EditorGUI.BeginDisabledGroup(!requirement.success);
            if (GUI.Button(rectButton, contButton))
            {
                this.Close();
                GameCreatorInstall.InstallUpdate();
            }
            EditorGUI.EndDisabledGroup();
            GUILayout.Space(WINDOW_P);

            EditorGUILayout.HelpBox(
                string.Format(MSG_INFO, Config.GetCurrent().version),
                MessageType.None
                );

            GUILayout.Space(WINDOW_P);
        }
Пример #2
0
        private void PaintBody()
        {
            this.scroll = EditorGUILayout.BeginScrollView(this.scroll, this.styleMargins);
            GameCreatorInstall.Requirement requirement = GameCreatorInstall.MeetsUnityRequirements();

            if (!requirement.success)
            {
                EditorGUILayout.HelpBox(
                    requirement.message,
                    MessageType.Error
                    );
            }
            else if (!string.IsNullOrEmpty(requirement.message))
            {
                EditorGUILayout.HelpBox(
                    requirement.message,
                    MessageType.Warning
                    );
            }

            if (this.updateData == null)
            {
                GUILayout.FlexibleSpace();
                EditorGUILayout.LabelField(
                    "No information available.",
                    EditorStyles.centeredGreyMiniLabel
                    );
                GUILayout.FlexibleSpace();
            }
            else
            {
                this.PaintBodyUpdateAvailable();
            }

            EditorGUILayout.EndScrollView();
        }