Exemplo n.º 1
0
    void ChangeLane(int direction)
    {
        int targetLane = currentLane + direction;

        if (targetLane < -1 || targetLane > 3)
        {
            return;
        }
        if (targetLane == -1)
        {
            camera1.Shake();
            targetLane += 1;
            StartCoroutine(CountHit());
        }
        if (targetLane == 3)
        {
            camera1.Shake();
            targetLane -= 1;
            StartCoroutine(CountHit());
        }

        currentLane            = targetLane;
        VerticalTargetPosition = new Vector3((currentLane - 1), 0, 0);
    }