Skip to content

Instantly share code, notes, and snippets.

@arkms
Created October 5, 2016 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arkms/239fd4e7d91cd47e279a993f2d6db1cc to your computer and use it in GitHub Desktop.
Save arkms/239fd4e7d91cd47e279a993f2d6db1cc to your computer and use it in GitHub Desktop.
Costum Update with delays between every call
//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