Advertisement
Eiromplays

IEnumerator

Sep 24th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. public void Start() // This can be public or private void whatever you want as long as it isn't taken I use start since it runs when the game starts.
  2.     {
  3.         StartCoroutine(Wait()); // This is how to start the IEnumerator Remember that Wait should be whatever you name it.
  4.     }
  5.  
  6.     IEnumerator Wait() // You can name it whatever you want like Test as long as it isn't taken already
  7.     {
  8.         Debug.Log("Start!");
  9.         yield return new WaitForSeconds(3); // 3 is the seconds it waits.
  10.         Debug.Log("Done!");
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement