Maze / Library /PackageCache /com.unity.inputsystem@1.6.1 /InputSystem /Plugins /XR /Haptics /GetHapticCapabilitiesCommand.cs
| // ENABLE_VR is not defined on Game Core but the assembly is available with limited features when the XR module is enabled. | |
| using System.Runtime.InteropServices; | |
| using UnityEngine.InputSystem.LowLevel; | |
| using UnityEngine.InputSystem.Utilities; | |
| namespace UnityEngine.InputSystem.XR.Haptics | |
| { | |
| public struct HapticCapabilities | |
| { | |
| public HapticCapabilities(uint numChannels, uint frequencyHz, uint maxBufferSize) | |
| { | |
| this.numChannels = numChannels; | |
| this.frequencyHz = frequencyHz; | |
| this.maxBufferSize = maxBufferSize; | |
| } | |
| public uint numChannels { get; private set; } | |
| public uint frequencyHz { get; private set; } | |
| public uint maxBufferSize { get; private set; } | |
| } | |
| [] | |
| public struct GetHapticCapabilitiesCommand : IInputDeviceCommandInfo | |
| { | |
| static FourCC Type => new FourCC('X', 'H', 'C', '0'); | |
| const int kSize = InputDeviceCommand.kBaseCommandSize + sizeof(uint) * 3; | |
| public FourCC typeStatic => Type; | |
| [] | |
| InputDeviceCommand baseCommand; | |
| [] | |
| public uint numChannels; | |
| [] | |
| public uint frequencyHz; | |
| [] | |
| public uint maxBufferSize; | |
| public HapticCapabilities capabilities => new HapticCapabilities(numChannels, frequencyHz, maxBufferSize); | |
| public static GetHapticCapabilitiesCommand Create() | |
| { | |
| return new GetHapticCapabilitiesCommand | |
| { | |
| baseCommand = new InputDeviceCommand(Type, kSize), | |
| }; | |
| } | |
| } | |
| } | |