Corutinas

https://docs.unity3d.com/es/current/Manual/Coroutines.html

Referent : https://eleazarcelis.wordpress.com/2015/10/03/entendiendo-las-coroutines-co-rutinas-unity3d/

Example

void Start () 
{
     StartCoroutine(Prueba());
}

IEnumerator Prueba() 
{
     print("1");

     yield return new WaitForSeconds(3);

     print("2");

     while (!Input.GetButtonDown("Fire1")) 
     {
         yield return null;
     }

     print("3");
}
Anuncios