public async Task PlayVibrationEffectAsync(Gamepad gamepad, string effectName, VibrationOptions options = null) { if (options == null) { options = new VibrationOptions(); } if (gamepad != null && gamepad.SupportVibration) { await _jsRuntime.InvokeVoidAsync("Antifree.Blazor.GamepadManager.playVibrationEffect", gamepad.Index, effectName, options); } }
public Task PlayVibrationEffectAsync(long gamepadIndex, string effectName, VibrationOptions options = null) { var gamepad = _gamepads.Find(g => g.Index == gamepadIndex); return(PlayVibrationEffectAsync(gamepad, effectName, options = null)); }