Пример #1
0
        public static void ShowWindow()
        {
            GlobalVariablesEditor window = EditorWindow.GetWindow <GlobalVariablesEditor>(false, "Global Variables");

            window.minSize = new Vector2(295f, 410f);
            //UnityEngine.Object.DontDestroyOnLoad (window);
        }
Пример #2
0
        public void OnGUI()
        {
            lockSelection   = PreferencesEditor.GetBool(Preference.LockSelection);
            showPreferences = PreferencesEditor.GetBool(Preference.ShowPreference);

            GUILayout.BeginHorizontal(EditorStyles.toolbar);
            SelectGameObject();
            SelectStateMachine();

            if (GUILayout.Button("Lock", (lockSelection?(GUIStyle)"TE toolbarbutton" : EditorStyles.toolbarButton), GUILayout.Width(50)))
            {
                lockSelection = !lockSelection;
                PreferencesEditor.SetBool(Preference.LockSelection, lockSelection);
            }

            if (GUILayout.Button("Tools", EditorStyles.toolbarDropDown, GUILayout.Width(50)))
            {
                GenericMenu menu = new GenericMenu();
                menu.AddItem(new GUIContent("Welcome Screen"), false, delegate() {
                    WelcomeWindow.ShowWindow();
                });
                menu.AddItem(new GUIContent("Global Variables"), false, delegate() {
                    GlobalVariablesEditor.ShowWindow();
                });
                menu.AddItem(new GUIContent("Action Browser"), false, delegate() {
                    ActionBrowser.ShowWindow();
                });
                menu.AddItem(new GUIContent("Condition Browser"), false, delegate() {
                    ConditionBrowser.ShowWindow();
                });
                menu.AddItem(new GUIContent("Error Console"), false, delegate() {
                    ErrorEditor.ShowWindow();
                });
                menu.AddItem(new GUIContent("Setup Shortcuts"), false, delegate() {
                    SetupShortcutsEditor.ShowWindow();
                });

                menu.AddItem(new GUIContent("Fsm Tool"), false, delegate() {
                    FsmTool.ShowWindow();
                });
                menu.AddItem(new GUIContent("MonoBehaviour Converter"), false, delegate() {
                    MonoBehaviourConverter.ShowWindow();
                });
                menu.AddItem(new GUIContent("Integrations"), false, delegate() {
                    //IntegrationWindow.ShowWindow ();
                });
                menu.ShowAsContext();
            }

            GUILayout.FlexibleSpace();
            if (GUILayout.Button(FsmEditorStyles.popupIcon, (showPreferences?(GUIStyle)"TE toolbarbutton" : EditorStyles.toolbarButton)))
            {
                showPreferences = !showPreferences;
                PreferencesEditor.SetBool(Preference.ShowPreference, showPreferences);
            }


            GUILayout.EndHorizontal();
        }
 public static void OpenGlobalVariablesEditor()
 {
     GlobalVariablesEditor.ShowWindow();
 }