Ejemplo n.º 1
0
    private void TryUseStriker(GamePad.Trigger trigger, Striker striker, ref bool triggerState)
    {
        float axis = GamePad.GetTrigger(trigger, PlayerShip.PlayerInfo.GamepadIndex);

        if (!triggerState)
        {
            if (axis >= gamepadTriggerSensitivity)
            {
                triggerState = true;
                striker.MoveBlade();
            }
        }
        else
        {
            if (axis < gamepadTriggerSensitivity)
            {
                triggerState = false;
                striker.StopBlade();
            }
        }
    }
Ejemplo n.º 2
0
 void GetGamepadTrigger(ref InputTrigger _button, GamePad.Trigger _gamepadButton, GamePad.Index _index)
 {
     _button.lastFrame = _button.thisFrame;
     _button.thisFrame = GamePad.GetTrigger(_gamepadButton, _index, true);
 }