Example #1
0
    /// <summary>
    /// Returns input value during the frame the user starts pressing down the key.
    /// </summary>
    /// <returns>Input value if button or axis become active during this frame.</returns>
    /// <param name="exactKeyModifiers">If set to <c>true</c> check that only specified key modifiers are active, otherwise check that at least specified key modifiers are active.</param>
    /// <param name="axis">Specific actions for axis (Empty by default).</param>
    /// <param name="device">Preferred input device.</param>
    public float GetValueDown(bool exactKeyModifiers = false, string axis = "", InputDevice device = InputDevice.Any)
    {
        float res = 0;
        float cur;

        cur = mPrimaryInput.GetInputDown(exactKeyModifiers, axis, device);

        if (cur > res)
        {
            res = cur;
        }

        cur = mSecondaryInput.GetInputDown(exactKeyModifiers, axis, device);

        if (cur > res)
        {
            res = cur;
        }

        cur = mThirdInput.GetInputDown(exactKeyModifiers, axis, device);

        if (cur > res)
        {
            res = cur;
        }

        return(res);
    }