martedì 28 giugno 2011

Introdurre il tempo nel codice

Come nella programmazione concorrente esiste la funzione yield - scritta senza () - che serve ad impostare un' attesa, nell'esecuzione del codice, di tot frame:

function Update(){
...
yield; //attende un frame
yield WaitForSeconds (2); //attende 2 secondi
...
}