示例#1
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();
        }
示例#2
0
        public static void ShowWindow()
        {
            MonoBehaviourConverter window = EditorWindow.GetWindow <MonoBehaviourConverter>("Converter");
            Vector2 size = new Vector2(250f, 250f);

            window.minSize = size;
            UnityEngine.Object.DontDestroyOnLoad(window);
        }
 public static void OpenConverterEditor()
 {
     MonoBehaviourConverter.ShowWindow();
 }