Exemplo n.º 1
0
 private void OnCommandReceived(string command)
 {
     if (m_commandParser != null)
     {
         if (command == "help")
         {
             Log(LogLevel.Debug, m_commandParser.PrintHelp());
         }
         else if (command == "clear")
         {
             m_consoleWindow.ClearMessageLog();
         }
         else if (command == "feedback")
         {
             m_feedbackUI.Open();
         }
         else if (command == "reset")
         {
             m_consoleWindow.ResetLayout();
             m_feedbackUI.ResetLayout();
         }
         else if (!string.IsNullOrEmpty(command))
         {
             m_commandParser.Run(command);
         }
     }
     else
     {
         OnLogMessageReceived("Command processor is not set!", null, LogType.Error);
     }
 }
Exemplo n.º 2
0
        public void Open(ICommandParser commandParser)
        {
            if (commandParser != null)
            {
                m_contentField.text = commandParser.PrintHelp();
            }
            else
            {
                m_contentField.text = "No command parser has been assigned.";
            }

            m_panel.gameObject.SetActive(true);
            DebugConsole.Lock(false);
        }