Auto Typing in Unity 3d [ Video ]

Advertisemen

This video will show you how to make auto typing letter by letter in unity 3d in a really simple way.

 


Codes used in above video. This modified code block is for Unity 5x so if you are using Unity 4x, please uncomment one saying  for Unity 4x  and comment out one saying  for Unity 5x.

using UnityEngine;
using System.Collections;

public class AutoTyping : MonoBehaviour {
    string myString = "This is a auto typing text...";

    // Use this for initialization
    void Start () {
        StartCoroutine("AutoType");
    }
    
    // Update is called once per frame
    IEnumerator AutoType () {
        foreach(char letter in myString.ToCharArray()){
          GetComponent<GUIText>().text += letter//for unity 5x

          // guiText.text += letter;  // for unity 4x
          
yield return new WaitForSeconds(0.3f);
        }
    }
}

If this video is helpful, please like, comment, share and subscribe.

Thank you

Advertisemen

Disclaimer: Gambar, artikel ataupun video yang ada di web ini terkadang berasal dari berbagai sumber media lain. Hak Cipta sepenuhnya dipegang oleh sumber tersebut. Jika ada masalah terkait hal ini, Anda dapat menghubungi kami disini.

Tidak ada komentar:

Posting Komentar

© Copyright 2017 Tutorial Unity 3D