예제 #1
0
        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);
            }
        }
예제 #2
0
        public Task PlayVibrationEffectAsync(long gamepadIndex, string effectName, VibrationOptions options = null)
        {
            var gamepad = _gamepads.Find(g => g.Index == gamepadIndex);

            return(PlayVibrationEffectAsync(gamepad, effectName, options = null));
        }