This is an infinite loop, probably not intentional.
Loving the series, coming from a C++ background I have been muddling through using C# like C, it's really great to see explanations of these other features.
I don't like the idea of calling these coroutines much, because it doesn't appear that they have pausing in mind. I've mostly been using events to listen to when pausing and unpausing happens, and enabling scripts based on this. So I've been making very little use of yield. StopAllCoroutines seems like the only other option, but maybe I don't want to stop all of them. I'd love to see a video about how you deal with pausing in an advanced C#-kinda way. Thanks for a great series so far!
@JessyUV Coroutines are incredibly useful so don't write them off just yet. There are definitely ways to pause, resume, delay, etc coroutines that is actually pretty easy to implement. StopAllCoroutines is a bit heavy for many real world scenarios when you have many coroutines going about their business but it is handy for simpler cases. Perhaps the next video will have some tidbits on that front...
while (startTime < endTime) ?
This is an infinite loop, probably not intentional.
Loving the series, coming from a C++ background I have been muddling through using C# like C, it's really great to see explanations of these other features.
Petrozium 8 months ago
I don't like the idea of calling these coroutines much, because it doesn't appear that they have pausing in mind. I've mostly been using events to listen to when pausing and unpausing happens, and enabling scripts based on this. So I've been making very little use of yield. StopAllCoroutines seems like the only other option, but maybe I don't want to stop all of them. I'd love to see a video about how you deal with pausing in an advanced C#-kinda way. Thanks for a great series so far!
JessyUV 1 year ago
@JessyUV Coroutines are incredibly useful so don't write them off just yet. There are definitely ways to pause, resume, delay, etc coroutines that is actually pretty easy to implement. StopAllCoroutines is a bit heavy for many real world scenarios when you have many coroutines going about their business but it is handy for simpler cases. Perhaps the next video will have some tidbits on that front...
prime31studios 1 year ago