Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void OnGUI () {
- if (useTypeWriter) {
- curDialog.dialogTypeWrite = "";
- StartCoroutine(TypeText(curDialog.dialogText));
- GUILayout.Label(curDialog.dialogTypeWrite);
- }
- else {
- GUILayout.Label(curDialog.dialogText);
- }
- }
- IEnumerator TypeText (string s) {
- foreach (char c in s.ToCharArray()) {
- curDialog.dialogTypeWrite += c;
- yield return new WaitForSeconds (letterPause);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement