Пример #1
0
 private void TitleGUI()
 {
     if (IsAdminMode)
     {
         GUI.backgroundColor = _adminModeColor;
         GUILayout.BeginHorizontal(EditorStyles.toolbar);
         GUILayout.Label("Developer Mode");
         GUILayout.FlexibleSpace();
         if (GUILayout.Button("Logout", EditorStyles.toolbarPopup))
         {
             IsAdminMode = false;
         }
         GUILayout.EndHorizontal();
         GUI.backgroundColor = Color.white;
     }
     else
     {
         GUILayout.BeginHorizontal(EditorStyles.toolbar);
         GUILayout.FlexibleSpace();
         if (GUILayout.Button("Admin Login", EditorStyles.toolbarPopup))
         {
             AdminLoginWindow.OpenWindow(this);
         }
         GUILayout.EndHorizontal();
     }
 }
Пример #2
0
        protected void OnGUI()
        {
            OnGUIReady();

            if (IsEnableTitleGUI)
            {
                GUI.backgroundColor = IsAdminMode ? AdminModeColor : Color.white;

                GUILayout.BeginHorizontal(EditorStyles.toolbar);

                if (IsAdminMode)
                {
                    GUILayout.Label(GetWord("Admin Mode"));
                }

                OnTitleGUI();

                if (_localizeWindow != null)
                {
                    if (GUILayout.Button(GetWord("Localize"), EditorStyles.toolbarPopup))
                    {
                        GenericMenu gm = new GenericMenu();
                        gm.AddItem(new GUIContent("简体中文"), CurrentLanguage == Language.Chinese, () =>
                        {
                            CurrentLanguage = Language.Chinese;
                        });
                        gm.AddItem(new GUIContent("English"), CurrentLanguage == Language.English, () =>
                        {
                            CurrentLanguage = Language.English;
                        });
                        if (IsEnableKorean)
                        {
                            gm.AddItem(new GUIContent("한국어"), CurrentLanguage == Language.Korean, () =>
                            {
                                CurrentLanguage = Language.Korean;
                            });
                        }
                        else
                        {
                            gm.AddDisabledItem(new GUIContent("한국어"));
                        }
                        if (IsEnableJapanese)
                        {
                            gm.AddItem(new GUIContent("日本語"), CurrentLanguage == Language.Japanese, () =>
                            {
                                CurrentLanguage = Language.Japanese;
                            });
                        }
                        else
                        {
                            gm.AddDisabledItem(new GUIContent("日本語"));
                        }
                        gm.ShowAsContext();
                    }
                }

                if (_adminLoginWindow != null)
                {
                    if (IsAdminMode)
                    {
                        if (GUILayout.Button(GetWord("Logout"), EditorStyles.toolbarPopup))
                        {
                            IsAdminMode = false;
                        }
                    }
                    else
                    {
                        if (GUILayout.Button(GetWord("Admin Login"), EditorStyles.toolbarPopup))
                        {
                            AdminLoginWindow.OpenWindow(_adminLoginWindow, OnAdminCheck);
                        }
                    }
                }

                if (!string.IsNullOrEmpty(HelpUrl))
                {
                    if (GUILayout.Button(_helpGC, EditorGlobalTools.Styles.IconButton))
                    {
                        Application.OpenURL(HelpUrl);
                    }
                }

                GUILayout.EndHorizontal();

                GUI.backgroundColor = Color.white;
            }

            OnBodyGUI();
        }