// Update is called once per frame void Update() { ChatBox cx = chatbox.GetComponent <ChatBox>(); if (Input.GetButtonDown("Submit") && input.text != "") { _instruction = input.text; input.text = ""; string result = TextMatching(); cx.UpdateScreen(_instruction + "\n" + result); } string res = PassTime(); if (res != "") { cx.UpdateScreen("--another day passes"); } }