private void OnCategoryContextClicked(UnityEditorMemoCategory caterogy)
        {
            var menu = new GenericMenu();

            if (caterogy == null)
            {
                menu.AddItem(new GUIContent("Create"), false, () => {
                    OnCategoryCreate();
                });
            }
            else
            {
                if (caterogy.Name != "default")
                {
                    menu.AddItem(new GUIContent("Rename"), false, () => {
                        categoryTreeView.BeginRename(caterogy);
                    });
                    menu.AddSeparator("");
                    menu.AddItem(new GUIContent("Delete"), false, () => {
                        OnCategoryDelete(caterogy);
                    });
                }
            }
            menu.ShowAsContext();
        }
Beispiel #2
0
        private void OnCategoryDelete(UnityEditorMemoCategory category)
        {
            UndoHelper.EditorMemoUndo(UndoHelper.UNDO_DELETE_CATEGORY);

            WindowHelper.Data.Category.Remove(category);
            CategoryTreeViewInitialize();
            MemoTreeViewInitialize();
        }
        public static List <UnityEditorMemo> DisplayMemoList(UnityEditorMemoCategory currentCategory, int label)
        {
            if (Data == null)
            {
                return(null);
            }

            return(currentCategory.Memo.Where(m => label == 0 || m.Label == ( UnityEditorMemoLabel )label).Reverse().ToList());
        }
Beispiel #4
0
        private void OnCategoryCreate()
        {
            UndoHelper.EditorMemoUndo(UndoHelper.UNDO_CREATE_CATEGORY);

            var newCategory = new UnityEditorMemoCategory("new Category");

            WindowHelper.Data.AddCategory(newCategory);
            CategoryTreeViewInitialize();
            categoryTreeView.BeginRename(newCategory);
        }
Beispiel #5
0
 private void memoPostProcess(UnityEditorMemoCategory category, UnityEditorMemo memo)
 {
     category.AddMemo(memo);
     memoText       = "";
     postMemoTex    = 0;
     postMemoUrl    = "";
     memoScrollView = Vector2.zero;
     if (selectLabel == 0)
     {
         postMemoLabel = 0;
     }
     GUIUtility.keyboardControl = 0;
 }
Beispiel #6
0
        private void OnMemoPost(UnityEditorMemoCategory category, UnityEditorMemo memo)
        {
            UndoHelper.EditorMemoUndo(UndoHelper.UNDO_POST);

            category.AddMemo(memo);
            category.Initialize();
            memoText    = "";
            postMemoTex = 0;
            postMemoUrl = "";
            if (selectLabel == 0)
            {
                postMemoLabel = 0;
            }
            GUIUtility.keyboardControl = 0;
            MemoTreeViewInitialize();
        }
Beispiel #7
0
 public static List <UnityEditorMemo> DisplayMemoList(UnityEditorMemoCategory currentCategory, int label, int displayMode)
 {
     if (Data == null)
     {
         return(null);
     }
     if (currentCategory.IsDevideMemo(label))
     {
         var memo = currentCategory.Memo.Where(m => label == 0 || m.Label == ( UnityEditorMemoLabel )label);
         if (displayMode == 1)   // 101 -
         {
             return(memo.Select(m => m).Reverse().Skip(100).ToList());
         }
         else
         {
             return(memo.Select(m => m).Reverse().Take(100).ToList());
         }
     }
     else
     {
         return(currentCategory.Memo.Where(m => label == 0 || m.Label == ( UnityEditorMemoLabel )label).Reverse().ToList());
     }
 }
Beispiel #8
0
        public void BeginRename(UnityEditorMemoCategory rename)
        {
            var id = category.IndexOf(rename);

            BeginRename(GetRows()[id]);
        }