Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. StartCoroutine("functioncalls", 2f);
  2. StartCoroutine(functioncalls());
  3.  
  4. void Call()
  5. {
  6. Invoke("FunctionCall",2f);
  7. }
  8.  
  9. void FunctionCall()
  10. {
  11. Debug.Log("this function run");
  12. }
  13.  
  14. void Call()
  15. {
  16. StartCoroutine(functioncalls());
  17. }
  18.  
  19. IEnumerator functioncalls()
  20. {
  21. yield return new WaitForSeconds(2f);
  22. Debug.Log("this function run");
  23. }
  24.  
  25. IEnumerator Countdown(int seconds)
  26. {
  27. while (seconds > 0) {
  28. Debug.Log(seconds);
  29. seconds--;
  30. yield return new WaitForSeconds(1f);
  31. }
  32. Debug.Log("Go!);
  33. }
  34.  
  35. StartCoroutine(Countdown(10));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement