示例#1
0
    // Wheel rotation animation
    private void wheelAnimation()
    {
        foreach (AxleInformation axle in axleInformation)
        {
            if (!axle.canTurn)
            {
                continue;
            }
            axle.leftWheel.localRotation = Quaternion.Euler(
                axle.leftWheel.localRotation.eulerAngles.x,
                motor.getTurnInput() * axle.maxWheelTurn,
                axle.leftWheel.localRotation.eulerAngles.z);

            axle.rightWheel.localRotation = Quaternion.Euler(
                axle.rightWheel.localRotation.eulerAngles.x,
                motor.getTurnInput() * axle.maxWheelTurn,
                axle.rightWheel.localRotation.eulerAngles.z);
        }
    }