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