Update() is not coroutine, and I don't think you can change that. You could try making a 'while' loop in an IEnumerator. Start the coroutine in Start(), and the 'while' loop will cause it to repeat over and over again.
void Start () {
StartCoroutine("Example");
}
IEnumerator Example () {
while(true){ //this makes the loop itself
yield return new WaitForSeconds(2);
//do stuff
//if you want to stop the loop, use: break;
}
}
↧