unity delay 1 second code example
Example 1: Time delay C# unity
void start()
StartCoroutine(Text());
IEnumerator Text()
{
Debug.Log("Hello")
yield return new WaitForSeconds(3)
Debug.Log("ByeBye")
}
Example 2: java pause 1 second
try {
Thread.sleep(1000);
} catch (InterruptedException e) {e.printStackTrace();}
Timer timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
}
}, 1000);
Example 3: wait time in unity
using System.Collections;
private void Start()
{
StartCoroutine(Wait());
}
IEnumerator Wait()
{
yield return new WaitForSeconds();
}