Microsoft.Xna.Framework.Input.GamePad.PlatformSetVibration C# (CSharp) Method

PlatformSetVibration() private static method

private static PlatformSetVibration ( int index, float leftMotor, float rightMotor ) : bool
index int
leftMotor float
rightMotor float
return bool
        private static bool PlatformSetVibration(int index, float leftMotor, float rightMotor)
        {
            if (index >= WGI.Gamepad.Gamepads.Count)
                return false;

            var gamepad = WGI.Gamepad.Gamepads[index];

            gamepad.Vibration = new WGI.GamepadVibration
            {
                LeftMotor = leftMotor,
                LeftTrigger = leftMotor,
                RightMotor = rightMotor,
                RightTrigger = rightMotor
            };

            return true;
        }
    }