OK I’m feeling kind of silly for not figuring out out to use the yield with coroutines and waitforseconds…
I would really appreciate if somebody could explain how to achieve this, in C# code:
void Update()
{
if(condition)
handleSomething();
}
void handleSomething()
{
// do some things
// wait for some amount of time (variable)
// do some more things
}
I’ve tried with the StartCoroutine inside my handleSomething, then yield return new WaitForSeconds (??) in the coroutine, but it doesn’t behave correctly.
Anyone? Thanks!
joe@threemelons