arenos-nexus/Arenos Nexus/Library/PackageCache/com.unity.inputsystem@be6c4fd0abf5/InputSystem/Plugins/XR/Haptics/BufferedRumble.cs

27 lines
765 B
C#
Raw Permalink Normal View History

2025-09-25 22:01:28 +02:00
namespace UnityEngine.InputSystem.XR.Haptics
{
public struct BufferedRumble
{
public HapticCapabilities capabilities { get; private set; }
InputDevice device { get; set; }
public BufferedRumble(InputDevice device)
{
if (device == null)
throw new System.ArgumentNullException(nameof(device));
this.device = device;
var command = GetHapticCapabilitiesCommand.Create();
device.ExecuteCommand(ref command);
capabilities = command.capabilities;
}
public void EnqueueRumble(byte[] samples)
{
var command = SendBufferedHapticCommand.Create(samples);
device.ExecuteCommand(ref command);
}
}
}