Exemplo n.º 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();
        }
Exemplo n.º 2
0
		public static FsmEditor ShowWindow()
		{
			if(PreferencesEditor.GetBool(Preference.ShowWelcomeWindow) && Resources.FindObjectsOfTypeAll<FsmEditor>().Length == 0){
				WelcomeWindow.ShowWindow();
			}
			FsmEditor window = EditorWindow.GetWindow<FsmEditor>("FSM");
			return window;
		}
        public static void ShowWindow()
        {
            WelcomeWindow window = EditorWindow.GetWindow <WelcomeWindow>(true, "Welcome to ICode");
            Vector2       size   = new Vector2(340f, 310f);

            window.minSize = size;
            window.maxSize = size;
            Object.DontDestroyOnLoad(window);
        }
 public static void OpenWelcomeWindow()
 {
     WelcomeWindow.ShowWindow();
 }