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.

SetSamplingFrequencyCommand.cs 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Runtime.InteropServices;
  2. using UnityEngine.InputSystem.Utilities;
  3. ////REVIEW: switch this to interval-in-seconds instead of Hz?
  4. namespace UnityEngine.InputSystem.LowLevel
  5. {
  6. /// <summary>
  7. /// For a device that is sampled periodically, set the frequency at which the device
  8. /// is sampled.
  9. /// </summary>
  10. [StructLayout(LayoutKind.Explicit, Size = kSize)]
  11. public struct SetSamplingFrequencyCommand : IInputDeviceCommandInfo
  12. {
  13. public static FourCC Type { get { return new FourCC('S', 'S', 'P', 'L'); } }
  14. internal const int kSize = InputDeviceCommand.kBaseCommandSize + sizeof(float);
  15. [FieldOffset(0)]
  16. public InputDeviceCommand baseCommand;
  17. [FieldOffset(InputDeviceCommand.kBaseCommandSize)]
  18. public float frequency;
  19. public FourCC typeStatic
  20. {
  21. get { return Type; }
  22. }
  23. public static SetSamplingFrequencyCommand Create(float frequency)
  24. {
  25. return new SetSamplingFrequencyCommand
  26. {
  27. baseCommand = new InputDeviceCommand(Type, kSize),
  28. frequency = frequency
  29. };
  30. }
  31. }
  32. }