Quantcast
Channel: Latest Questions by Grievemourne
Viewing all articles
Browse latest Browse all 51

What is the best method for setting up a variable wait time in a coroutine?

$
0
0
There's a point in a coroutine where I have the typical yield return new WaitForSeconds(variableTime); but if something happens in the meantime, I would like to force the coroutine to stop waiting and move on to the next step. I've been thinking of doing a while loop, checking if a boolean has changed and how much time has passed, but not sure if this is the most efficient way if I can instead just change the variableTime to 0 and/or just have it move on instead of checking for more.

Viewing all articles
Browse latest Browse all 51

Trending Articles



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