Quantcast
Channel: Questions in topic: "invokerepeating"
Viewing all articles
Browse latest Browse all 220

Coroutine in place of InvokeRepeating in need of start at time parameter

$
0
0
IEnumerator SendSpriteForward(int no, Coroutine n,int prevhighestorderInlayer) { while (true) { StopCoroutine (n); for (int i = 0; i < gameObjectsContainer.transform.childCount; i++) { gameObjectsContainer.GetChild (i).transform.GetChild (no).GetComponent ().sortingOrder = gameObjectsContainer.GetChild (i).transform.GetChild (prevhighestorderInlayer).GetComponent ().sortingOrder + 1; } n = StartCoroutine (GenericCoroutine (no, 0)); yield return new WaitForSeconds (6); } } I need to call this coroutine in start method at different times . In start Method i want to call them as such StartCoroutine(SendSpriteForward(5,one,0)); //start this call at 6 second StartCoroutine(SendSpriteForward(4,two,5)); // this at 7 StartCoroutine(SendSpriteForward(3,three,4));//8 StartCoroutine(SendSpriteForward(2,four,3));//9 StartCoroutine(SendSpriteForward(1,five,2));//10 StartCoroutine(SendSpriteForward(0,six,1));//11 and so . The Repeating functionality has been attained but the start time i need to. Thank you.

Viewing all articles
Browse latest Browse all 220


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>