// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Q)) { Debug.Log("Q hit"); Textbox_Controller.AddNewText(Strings[Counter]); Counter++; Counter %= 5; } else if (Input.GetKeyDown(KeyCode.W)) { Debug.Log("W hit"); Textbox_Controller.AddNewText(new string[] { "Group string 1", "group string 2", "group 3" }, 3); } else if (Input.GetKeyDown(KeyCode.E)) { Debug.Log("E hit"); Textbox_Controller.AddTextByLineNumber(1); } else if (Input.GetKeyDown(KeyCode.R)) { Debug.Log("R hit"); Textbox_Controller.AddTextByLineNumber(3); } }
//static public string nameTag; //static public string portrait; // Start is called before the first frame update void Awake() { instance = this; isClosing = false; text = new string[50]; script = Resources.Load <TextAsset>("Script/Test_Script"); //scriptText = script.text.Split("\n"[0]); scriptText = script.text.Split(new string[] { "\r\n\r\n" }, System.StringSplitOptions.None); Debug.Log(scriptText.Length); //nameTag = null; //portrait = null; }
private void Update() { if (!EventHandler.isBusy && !Textbox_Controller.isClosing && canTrigger && Input.GetKeyDown(KeyCode.Space)) { switch (Index) { case 1: Textbox_Controller.AddNewText("Test"); break; default: Textbox_Controller.AddNewText("ERROR"); Debug.LogError("This event does not exist: " + Index); break; } } }