Skip to content

Instantly share code, notes, and snippets.

@KzoNag
Created December 14, 2022 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KzoNag/730513e7db2620649260cdadf5df9c78 to your computer and use it in GitHub Desktop.
Save KzoNag/730513e7db2620649260cdadf5df9c78 to your computer and use it in GitHub Desktop.
ブログ用 - ハンドデバイス定義
#if UNITY_EDITOR
[InitializeOnLoad]
#endif
[Preserve]
[InputControlLayout(displayName = "Hand Pointer", stateType = typeof(HandDeviceState), commonUsages = new[] { "LeftHand", "RightHand" }, isGenericTypeOfDevice = false)]
public class HandDevice : XRController
{
public AxisControl grip { get; private set; }
public ButtonControl gripButton { get; private set; }
protected override void FinishSetup()
{
base.FinishSetup();
grip = GetChildControl<AxisControl>(nameof(grip));
gripButton = GetChildControl<ButtonControl>(nameof(gripButton));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment