Beispiel #1
0
    void TakeInput()
    {
        brakeInput    = TouchInput.GetDampedBrakeInput();
        gasInput      = -TouchInput.GetDampedGasInput();
        brakeRawInput = TouchInput.GetRawBrakeInput();
        gasRawInput   = -TouchInput.GetRawGasInput();

        finalInput    = brakeRawInput > 0f ? brakeInput : gasInput;
        finalRawInput = brakeRawInput > 0f ? brakeRawInput : gasRawInput;
    }
    void Update()
    {
        float brakeInput = TouchInput.GetRawBrakeInput();
        float gasInput   = TouchInput.GetRawGasInput();

        if (brakeInput > 0)
        {
            DisplayBrakePressed(true);
        }
        else
        {
            DisplayBrakePressed(false);
        }
        if (gasInput > 0)
        {
            DisplayGasPressed(true);
        }
        else
        {
            DisplayGasPressed(false);
        }
    }