IEnumerator SnakeMove() { LastPosition = Transform.Position; switch (CurrentDir) { case SnakeDirection.Up: Transform.Position += QVec.Up * Movement; break; case SnakeDirection.Down: Transform.Position += QVec.Down * Movement; break; case SnakeDirection.Left: Transform.Position += QVec.Left * Movement; break; case SnakeDirection.Right: Transform.Position += QVec.Right * Movement; break; default: break; } yield return(QCoroutine.WaitForSeconds(snakeMoveSpeed)); Coroutine.Start(SnakeMove()); }
IEnumerator Thing() { Instantiate(new QDemoCircle()); yield return(QCoroutine.WaitForSeconds(1)); Coroutine.Start(Thing()); //probably bad }