Example #1
0
    // Pedal Controls

    /* Method controls what happens when a pedal is pressed:
     * The pedal image becomes smaller The rudder rotates depending on the
     * which pedal pressed */
    public static void PedalDown(Button pedal, float degrees)
    {
        pedal.transform.localScale = pedalSmallsize;
        if (pedal == rightPedal)
        {
            Vector3 rudderRotation =
                new Vector3(rudderStartingRotations.x, rudderStartingRotations.y, -degrees);
            rudder.Rotate(rudderRotation);
        }
        else if (pedal == leftPedal)
        {
            Vector3 rudderRotation =
                new Vector3(rudderStartingRotations.x, rudderStartingRotations.y, degrees);
            rudder.Rotate(rudderRotation);
        }
    }