Пример #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
 public void OnAction()
 {
     if (_viewBuilder.actionButtonCallback != null)
     {
         try
         {
             _viewBuilder.actionButtonCallback();
             if (_viewBuilder.closeAllSubViewOnAction)
             {
                 LogConsole.CloseAllSubView();
             }
         }
         catch (Exception e)
         {
             Debug.LogException(e);
         }
     }
 }
Пример #3
0
 public void OnClosed()
 {
     LogConsole.CloseAllSubView();
 }