Guest User

Untitled

a guest
Jul 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. public class Class1
  2. {
  3. class Dele {
  4.  
  5. delegate void MyDelegate();
  6. private MyDelegate dele;
  7.  
  8. private int count = 0;
  9.  
  10. public void Animate() {
  11. dele = new MyDelegate(DoIe);
  12. }
  13.  
  14. IEnumerator Ie() {
  15. Debug.Log(count);
  16. count += 1;
  17. yield return new WaitForSeconds(5f);
  18. }
  19.  
  20. private void DoIe() {
  21. StartCouroutine(Ie());
  22. for (int i=0; i<10; i++) {
  23. dele += DoIe;
  24. }
  25.  
  26. dele();
  27. }
  28. }
  29.  
  30. //call new Dele().Animate() here
  31. }
Add Comment
Please, Sign In to add comment