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