UI 자동화를 위해 바인딩 기능 구현
- 유니티 에셋 인증 오류로 meta 재생성
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
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),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user