MonoBehaviour.OnEnable Manual     Reference     Scripting  
Scripting > Runtime Classes > MonoBehaviour
MonoBehaviour.OnEnable

function OnEnable () : void

Description

This function is called when the object becomes enabled and active.

JavaScript
function OnEnable () {
print("script was enabled");
}

OnEnable cannot be a co-routine.