public static void HandleDropdown(int index, TMP_Dropdown dd, UnityEvent_string stringNotify)
 {
     if (stringNotify.GetPersistentEventCount() == 0)
     {
         return;
     }
     if (index >= 0 && index < dd.options.Count)
     {
         TMP_Dropdown.OptionData o = dd.options[index];
         stringNotify.Invoke(o.text);
     }
 }
        public void DoCommand(string text)
        {
            UnityConsole console = GetComponent <UnityConsole>();

            CommanderInstance.ParseCommand(new Commander.Instruction(text, this), console.Write, out Tokenizer t);
            if (t?.errors?.Count > 0)
            {
                console.PushForeColor(ConsoleColor.Red);
                console.WriteLine(t.GetErrorString());
                Show.Log(t.GetErrorString());
                console.PopForeColor();
            }
            WhenCommandRuns?.Invoke(text);
        }
Example #3
0
        public void FinishCurrentInput()
        {
            string processedInput = ProcessInput(currentLine.ToString());

            //Show.Log(currentLine.ToString().StringifySmall()+" -> "+processedInput.StringifySmall());
            currentLine.Clear();
            indexInCurrentLine = 0;
            console.Write("\n");
            console.body.RestartWriteCursor();
            if (string.IsNullOrEmpty(processedInput))
            {
                return;
            }
            inputListener.Invoke(processedInput);
            if (IsListeningToLine())
            {
                tempLineInputListeners.ForEach(action => action.Invoke(processedInput));
                tempLineInputListeners.Clear();
            }
        }
 public override void OnEventRaised(string item)
 {
     Response.Invoke(item);
 }