Created
October 5, 2016 02:15
-
-
Save arkms/239fd4e7d91cd47e279a993f2d6db1cc to your computer and use it in GitHub Desktop.
Costum Update with delays between every call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Intervalo entre cada Update,, la ventaja es que podemos cambiar | |
//su valor ya sea dentro del mismo cUpdate o desde otra función. | |
float intervalos = 0.5f; | |
void Start() | |
{ | |
StartCoroutine(cUpdate()); | |
} | |
IEnumerator cUpdate() | |
{ | |
while(true) | |
{ | |
//Codigo | |
print("accion"); | |
//Esperamos el tiempo definido que tenga 'intervalo' | |
yield return new WaitForSeconds(intervalos); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment