Advertisement
_EagleOwle_

Coroutine Wait Time

Jun 24th, 2021
577
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.30 KB | None | 0 0
  1. IEnumerator WaitCoroutine(float time)
  2.     {
  3.         yield return new WaitForSeconds(time);
  4.  
  5.         towers = GameObject.FindObjectsOfType<Tower>();
  6.         towers.OrderBy((d) => (d.transform.position - transform.position).sqrMagnitude).ToArray();
  7.  
  8.         StartCoroutine(WaitCoroutine(time));
  9.  
  10.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement