Static IEnumerator!?

Hey folks, I have a function that just don't run... summarizing, is this:

//Js

class Joemerson
{
   static funtion Falar(n : int)
   {
      ...
      while (shomething)
      {
         yield WaitForEndOfFrame();
      }
   }
}

This function needs to be called by another scripts, sometimes.

Please, help!

1 Answer

1

You'd have to start it with StartCoroutine from the other classes

Well, this won't work because coroutines are bound to the MonoBehaviour script that invokes it. StartCoroutine is a (non static) member function of MonoBehaviour so it needs a script instance to run on.

True, I blame lack of sleep on that one ;)