예제 #1
0
        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());
        }
예제 #2
0
        IEnumerator Thing()
        {
            Instantiate(new QDemoCircle());
            yield return(QCoroutine.WaitForSeconds(1));

            Coroutine.Start(Thing());             //probably bad
        }