Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. void OnGUI () {
  2.  
  3.     if (useTypeWriter) {
  4.         curDialog.dialogTypeWrite = "";
  5.         StartCoroutine(TypeText(curDialog.dialogText));
  6.         GUILayout.Label(curDialog.dialogTypeWrite);
  7.     }
  8.     else {
  9.         GUILayout.Label(curDialog.dialogText);
  10.     }
  11. }
  12.  
  13. IEnumerator TypeText (string s) {
  14.     foreach (char c in s.ToCharArray()) {
  15.         curDialog.dialogTypeWrite += c;
  16.         yield return new WaitForSeconds (letterPause);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement