示例#1
0
        void OnCommandSelected(GenericNodeView nodeView)
        {
            Command command = _commands.Find(c => c.info.name == nodeView.name);

            if (command != null)
            {
                if (command.info.IsComplex())
                {
                    if (!_commandDetailViewBuilders.ContainsKey(command))
                    {
                        _commandDetailViewBuilders[command] = new CommandDetailViewBuilder(command);
                    }

                    LogConsole.PushSubView(_commandDetailViewBuilders[command]);
                }
                else
                {
                    try
                    {
                        command.Execute();
                    }
                    catch (Exception e)
                    {
                        Debug.LogException(e);
                    }

                    if (command.info.shouldCloseAfterExecuted)
                    {
                        LogConsole.CloseAllSubView();
                    }
                }
            }
        }
示例#2
0
        static void _SetNodeIconColorRecursive(GenericNodeView node, Color color)
        {
            if (node == null)
            {
                return;
            }

            node.iconColor = color;
            foreach (var child in node.children)
            {
                _SetNodeIconColorRecursive(child as GenericNodeView, color);
            }
        }
示例#3
0
        protected GenericNodeView AddResizableText(string text, string icon, string id, Node parentNode)
        {
            if (parentNode == null)
            {
                parentNode = _rootNode;
            }

            GenericNodeView node = new GenericNodeView();

            node.resizable = true;
            node.name      = text;
            node.icon      = icon;
            parentNode.AddNode(node);
            return(node);
        }
        void OnCustomButtom(GenericNodeView nodeView)
        {
            MethodInfo methodInfo = (MethodInfo)nodeView.data;

            if (methodInfo != null)
            {
                try
                {
                    methodInfo.Invoke(_command, null);
                }
                catch (System.Exception e)
                {
                    Debug.LogException(e);
                }
            }
        }
示例#5
0
        protected GenericNodeView AddButton(string name, string icon, GenericNodeView.Callback callback, string id, Node parentNode)
        {
            if (parentNode == null)
            {
                parentNode = _rootNode;
            }

            GenericNodeView node = new GenericNodeView();

            node.id       = id;
            node.name     = name;
            node.icon     = icon;
            node.callback = callback;
            parentNode.AddNode(node);
            return(node);
        }
示例#6
0
 void DisableAll(GenericNodeView nodeView)
 {
     SetEnableAll(false);
 }
示例#7
0
 void EnableAll(GenericNodeView nodeView)
 {
     SetEnableAll(true);
 }
示例#8
0
 protected virtual void OnCategoryToggled(GenericNodeView nodeView)
 {
     nodeView.ToggleExpand();
     _rootNode.RebuildFlattenVisibleChilds();
     NotifyRequireUpdateUI(UpdateUIType.CellVisibleChanged);
 }
示例#9
0
 protected override void OnCategoryToggled(GenericNodeView nodeView)
 {
     base.OnCategoryToggled(nodeView);
     CategoryPlayerPrefs.SaveCategoryState(nodeView, ClassName);
 }