예제 #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);
 }