Beispiel #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();
                    }
                }
            }
        }
        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);
            }
        }
Beispiel #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);
                }
            }
        }
Beispiel #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);
        }
Beispiel #6
0
 void DisableAll(GenericNodeView nodeView)
 {
     SetEnableAll(false);
 }
Beispiel #7
0
 void EnableAll(GenericNodeView nodeView)
 {
     SetEnableAll(true);
 }
Beispiel #8
0
 protected virtual void OnCategoryToggled(GenericNodeView nodeView)
 {
     nodeView.ToggleExpand();
     _rootNode.RebuildFlattenVisibleChilds();
     NotifyRequireUpdateUI(UpdateUIType.CellVisibleChanged);
 }
Beispiel #9
0
 protected override void OnCategoryToggled(GenericNodeView nodeView)
 {
     base.OnCategoryToggled(nodeView);
     CategoryPlayerPrefs.SaveCategoryState(nodeView, ClassName);
 }