예제 #1
0
 IEnumerator Typewriter(string text)
 {
     Revealtext.text = "";
     textbg.gameObject.SetActive(false);
     foreach (char c in text)
     {
         textbg.gameObject.SetActive(true);
         Revealtext.text = Revealtext.text + c;
         yield return(new WaitForSeconds(.03f));
     }
     Debug.Log("wait for input" + WaitForInput);
     if (WaitForInput)
     {
         yield return(null);
     }
     else
     {
         if (Callback != null)
         {
             Callback();
             Callback = null;
         }
     }
     yield return(null);
 }
예제 #2
0
 public void DisplayTextPopup(string text, TextCB CB = null, bool bcontinue = false)
 {
     StopCoroutine("Typewriter");
     StartCoroutine("Typewriter", (text));
     Callback     = CB;
     WaitForInput = bcontinue;
     Debug.Log("wait for input" + WaitForInput);
 }