Esempio n. 1
0
 public void AddItem(LogHistoryItem item)
 {
     _LogHistory.AddCommandLine(item);
     if (_LogHistory.LogCount >= 1)
     {
         _LogHistoryView.ScrollToShowItem(_LogHistory[_LogHistory.LogCount - 1]);
     }
 }
Esempio n. 2
0
        private void HandleReturnKeyPressed()
        {
            if (0 == _commandInput.CompareTo(""))
            {
                return;
            }

            //保存command line到loghistoryview中
            LogHistoryItem item = new LogHistoryItem(LogHistoryLogType.ConsoleInput, _commandInput, Time.time);

            _LogHistory.AddCommandLine(item);

            //判断_commandInput是否来自预设命令
            CommandHandlers.HandleCommand(_commandInput);

            //清空command line数据
            _commandInput = "";

            Event.current.Use();

            _LogHistoryView.ScrollToShowItem(_LogHistory[_LogHistory.LogCount - 1]);
        }