Skip to content

Instantly share code, notes, and snippets.

@fujimisakari
Last active August 29, 2015 13:57
Show Gist options
  • Save fujimisakari/9440408 to your computer and use it in GitHub Desktop.
Save fujimisakari/9440408 to your computer and use it in GitHub Desktop.
void Start () {
StartCoroutine("Coroutine1");
}
void Update () {
Debug.Log ("Update.");
}
public IEnumerator Coroutine1()
{
Debug.Log("Start-1");
Debug.Log("--------");
yield return StartCoroutine("Coroutine2");
Debug.Log("--------");
Debug.Log("Start-2");
yield return null;
Debug.Log("Start-3");
}
private IEnumerator Coroutine2()
{
Debug.Log("Nest-1");
yield return null;
Debug.Log("Nest-2");
yield return null;
Debug.Log("Nest-3");
}
// 実行結果
//
// Start-1
// --------
// Nest-1
// Update.
// Update.
// Nest-2
// Update.
// Nest-3
// --------
// Start-2
// Update.
// Start-3
// Update.
// Update.
// :
// :
Debug.Log("Nest-2");
yield return null;
Debug.Log("Nest-3");
Start-1
--------
Nest-1
Update.
Update.
Nest-2
Update.
Nest-3
--------
Start-2
Update.
Start-3
Update.
Update.
:
:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment