No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BufferedRumble.cs 989B

1234567891011121314151617181920212223242526272829
  1. // ENABLE_VR is not defined on Game Core but the assembly is available with limited features when the XR module is enabled.
  2. #if UNITY_INPUT_SYSTEM_ENABLE_XR && (ENABLE_VR || UNITY_GAMECORE) || PACKAGE_DOCS_GENERATION
  3. namespace UnityEngine.InputSystem.XR.Haptics
  4. {
  5. public struct BufferedRumble
  6. {
  7. public HapticCapabilities capabilities { get; private set; }
  8. InputDevice device { get; set; }
  9. public BufferedRumble(InputDevice device)
  10. {
  11. if (device == null)
  12. throw new System.ArgumentNullException(nameof(device));
  13. this.device = device;
  14. var command = GetHapticCapabilitiesCommand.Create();
  15. device.ExecuteCommand(ref command);
  16. capabilities = command.capabilities;
  17. }
  18. public void EnqueueRumble(byte[] samples)
  19. {
  20. var command = SendBufferedHapticCommand.Create(samples);
  21. device.ExecuteCommand(ref command);
  22. }
  23. }
  24. }
  25. #endif