Advertisement
Frank84

Coroutine

Jul 6th, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.23 KB | None | 0 0
  1. void OtherFunction()
  2. {
  3.     StartCoroutine(PlayNotes());
  4. }
  5.  
  6. IEnumerator void PlayNotes()
  7. {
  8.     for (int i = 0; i < newNotesCount; i++)
  9.     {
  10.         yield return new WaitForSeconds(TIME_INC);
  11.         int n = notesToPlay[i];
  12.         notes[n].Play();
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement