Firstborn/Library/PackageCache/com.unity.inputsystem@1.5.1/InputSystem/Plugins/XR/Haptics/GetCurrentHapticStateComman...
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

51 lines
1.6 KiB
C#

// ENABLE_VR is not defined on Game Core but the assembly is available with limited features when the XR module is enabled.
#if UNITY_INPUT_SYSTEM_ENABLE_XR && (ENABLE_VR || UNITY_GAMECORE) || PACKAGE_DOCS_GENERATION
using System.Runtime.InteropServices;
using UnityEngine.InputSystem.LowLevel;
using UnityEngine.InputSystem.Utilities;
namespace UnityEngine.InputSystem.XR.Haptics
{
public struct HapticState
{
public HapticState(uint samplesQueued, uint samplesAvailable)
{
this.samplesQueued = samplesQueued;
this.samplesAvailable = samplesAvailable;
}
public uint samplesQueued { get; private set; }
public uint samplesAvailable { get; private set; }
}
[StructLayout(LayoutKind.Explicit, Size = kSize)]
public struct GetCurrentHapticStateCommand : IInputDeviceCommandInfo
{
static FourCC Type => new FourCC('X', 'H', 'S', '0');
const int kSize = InputDeviceCommand.kBaseCommandSize + (sizeof(uint) * 2);
public FourCC typeStatic => Type;
[FieldOffset(0)]
InputDeviceCommand baseCommand;
[FieldOffset(InputDeviceCommand.kBaseCommandSize)]
public uint samplesQueued;
[FieldOffset(InputDeviceCommand.kBaseCommandSize + sizeof(int))]
public uint samplesAvailable;
public HapticState currentState => new HapticState(samplesQueued, samplesAvailable);
public static GetCurrentHapticStateCommand Create()
{
return new GetCurrentHapticStateCommand
{
baseCommand = new InputDeviceCommand(Type, kSize),
};
}
}
}
#endif