Ejemplo n.º 1
0
 public static void OpenWindow()
 {
     window              = GetWindow <AddTaskWindow>(false);
     window.minSize      = new Vector2(400, 200);
     window.titleContent = new GUIContent("Add Task");
     window.Show();
 }
Ejemplo n.º 2
0
        private void DrawToolbar()
        {
            using (new HorizontalBlock(EditorStyles.toolbar))
            {
                EditorGUILayout.LabelField("Working Environment", EditorStyles.boldLabel, GUILayout.Width(150));
                m_workEnv = (EnvType)EditorGUILayout.EnumPopup(m_workEnv, EditorStyles.toolbarPopup, GUILayout.Width(110));
                switch (m_workEnv)
                {
                case EnvType.CODETODO:
                    if (GUILayout.Button("Scan", EditorStyles.toolbarButton))
                    {
                        OnEnable();
                    }
                    break;

                case EnvType.TASKLIST:
                    if (GUILayout.Button("Add Task", EditorStyles.toolbarButton))
                    {
                        // 显示增加界面
                        AddTaskWindow.OpenWindow();
                    }
                    break;

                case EnvType.USER:

                    break;
                }

                GUILayout.FlexibleSpace();
                m_searchContent = DrawSearchField(m_searchContent, GUILayout.Width(200));
            }
        }