Ejemplo n.º 1
0
        void OnGUI()
        {
            tab = GUILayout.Toolbar(tab, new string[] { "Information", "Settings" }, EditorStyles.toolbarButton, null);

            if (tab == 0)              //Information Tab

            {
                if (GUILayout.Button("Add Task There"))
                {
                }

                EditorGUILayout.Space();

                if (currentTask == null)
                {
                    EditorGUILayout.LabelField("There is no task to show.");
                }
                else
                {
                    title = EditorGUILayout.TextArea(title, EditorStyles.largeLabel);
                    EditorGUILayout.Space();
                    description = EditorGUILayout.TextArea(description);

                    // 変更があったらApplyボタンを有効にする
                    //TODO: 位置が変わってもApplyボタンを有効にする
                    currentTaskHasChange = (title != currentTask.title ||
                                            description != currentTask.description);

                    using (new EditorGUILayout.HorizontalScope()) {
                        using (new EditorGUI.DisabledGroupScope(!currentTaskHasChange)){
                            if (GUILayout.Button("Apply"))
                            {
                                TaskGround.AddChange(new Change(currentTask.ID, ChangeType.Modify,
                                                                currentTask.position,
                                                                title != currentTask.title ? title: "",
                                                                description != currentTask.description ? description : ""));
                                currentTask.title       = title;
                                currentTask.description = description;
                                //TaskGround.OnChange (new Ch
                                //currentTaskHasChange = false;
                            }
                        }
                        if (GUILayout.Button("Delete"))
                        {
                            Change c = new Change("", ChangeType.Delete, new Vector3(0, 0, 0), "", "");
                            TaskGround.AddChange(c);
                            TaskGround.SelectingTask = null;
                        }
                    }
                }
            }
            else                //Setting Tab

            {
                EditorGUILayout.LabelField("Trello Settings", EditorStyles.boldLabel);
                if (trelloUsername == null || trelloUsername == "")                  //Not logged in
                {
                    EditorGUILayout.LabelField("Not logged in");
                    if (trelloIsAuthorizing)
                    {
                        tokenField_text = EditorGUILayout.TextField("Token", tokenField_text);
                        if (GUILayout.Button("Continue"))
                        {
                            AuthTrello(tokenField_text);
                        }
                    }
                    else
                    {
                        if (GUILayout.Button("Start Authorize"))
                        {
                            OpenTrelloAuth();
                        }
                    }
                }
                else                    //logged in
                {
                    EditorGUILayout.LabelField("Logged in as " + trelloUsername);
                    if (GUILayout.Button("Logout"))
                    {
                        LogoutTrello();
                    }
                    if (trelloBoardIDs.Count == 0)
                    {
                        EditorCoroutine.Start(ReloadTrelloBoards());
                    }
                    else
                    {
                        trelloBoardIndex = EditorGUILayout.Popup("Board", trelloBoardIndex, trelloBoardNames.ToArray(), null);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public WaitForSeconds(float time) : base()
 {
     this.time     = time;
     this.initTime = EditorApplication.timeSinceStartup;
     EditorCoroutine.AddWaitForSecondsList(this);
 }