Home > other >  Call time on coroutines yield return null
Call time on coroutines yield return null

Time:05-06

Coroutines have a yield return null: according to the unity of the official explanation is that the next frame until it continues to run, at the same time, according to the unity script lifecycle yield return null after the program should run behind the Update

Here is my question: in the Start Awake OnEnable coroutines running test Start
 private void Awake () 
{
//StartCoroutine (" tt ");
}

Private void OnEnable ()
{
//StartCoroutine (" tt ");
}

Private void the Start ()
{
StartCoroutine (" tt ");
}

Private int a=0;

Void the Update ()
{
Print (" Update ");

}
IEnumerator (tt)
{
Print (" IEnumerator ");
Yield return null;
Print (" tt ");

}

The result is:
Coroutines in the Start is performed after two Update, conform to the unity of official explanation
Awake/coroutines Onenable is executed directly after an Update, this is very strange, isn't it should be the next frame to perform, and how the frame is carried out
  • Related