Why can MonoBehavior.Start() return an IEnumerator?

The expected method signature is typically void Start() but in the Unity 4.5 project I’m working on, I’ve seen several instances of where another developer did this:

IEnumerator Start() {
   do {
      yield return null;
   } while (SomeCondition());

   ... startup code ...

This appears to be perfectly legal but I can’t find any reference to it in the Unity manual. This code compiles and during execution, the implied coroutine runs, suspending the startup of the object until SomeCondition() returns true.

Is this legal because Start() is considered a message and can return either void (most common) or an IEnumerator to be treated as a coroutine?

This approach seems cleaner and more readable. Is there an advantage or disadvantage to it over the more common:

void Start() {

Thanks in advance!

Most Unity callbacks can be coroutines. Unity automatically starts it as coroutine if it returns an IEnumerator. Only a few can’t be a coroutine. Most commonly: Awake, Update, LateUpdate, FixedUpdate, OnGUI, OnEnable, OnDisable, OnDestroy. I probably forgot some others, however it’s usually stated for each callback if it can be a coroutine or not.

It allows for any long running processes to complete during the start call before passing back control to the run loop to commence the Update calls…

I remember I did read that standard events like start and update can be co-routines in the past. But it was too long time ago and I was very new to unity. So I’m not sure 100%.

These days, as far as I know, standard event can’t / shouldn’t be co-routines. If we need a co-routine, we should start it with StartCoroutine() in the start or update events.