IEnumerator Update()
{
yield return MyMethod1();
yield return MyMethod2();
yield return MyMethod3();
}IEnumerator Start()
{
yield return MyMethod1();
yield return MyMethod2();
}void Start()
{
//Start the coroutine we define below named ExampleCoroutine.
StartCoroutine(ExampleCoroutine());
}
IEnumerator ExampleCoroutine()
{
//Print the time of when the function is first called.
Debug.Log("Started Coroutine at timestamp : " + Time.time);
//yield on a new YieldInstruction that waits for 5 seconds.
yield return new WaitForSeconds(5);
//After we have waited 5 seconds print the time again.
Debug.Log("Finished Coroutine at timestamp : " + Time.time);
} // GAME MANAGER
void Start()
{
StartCoroutine(CoroutineDelayAndRun());
}
IEnumerator CoroutineDelayAndRun()
{
yield return new WaitForSeconds(5);
Run(); // этот метод через 5 сек вызовется от старта корутины
}