-
-
Save KzoNag/78c074100c8e4a77fa6bb1c13dee808d to your computer and use it in GitHub Desktop.
ブログ用 - VIVE Flowのコントローラー定義
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Preserve] | |
#if UNITY_EDITOR | |
[UnityEditor.InitializeOnLoad] | |
#endif | |
[InputControlLayout(displayName = "Wave Controller", commonUsages = new[] { "LeftHand", "RightHand" })] | |
public class WaveController : XRControllerWithRumble | |
{ | |
[Preserve] | |
[InputControl(aliases = new[] { "RightControllerTrackingState", "LeftControllerTrackingState" })] | |
public new IntegerControl trackingState { get; private set; } | |
[Preserve] | |
[InputControl(aliases = new[] { "RightControllerIsTracked", "LeftControllerIsTracked" })] | |
public new ButtonControl isTracked { get; private set; } | |
[Preserve] | |
[InputControl(aliases = new[] { "RightControllerPosition", "LeftControllerPosition" })] | |
public new Vector3Control devicePosition { get; private set; } | |
[Preserve] | |
[InputControl(aliases = new[] { "RightControllerRotation", "LeftControllerRotation" })] | |
public new QuaternionControl deviceRotation { get; private set; } | |
[Preserve] | |
[InputControl(aliases = new[] { "RightControllerTriggerTriggerAxis", "LeftControllerTriggerTriggerAxis" })] | |
public AxisControl trigger { get; private set; } | |
// 省略... | |
protected override void FinishSetup() | |
{ | |
base.FinishSetup(); | |
trackingState = GetChildControl<IntegerControl>("trackingState"); | |
isTracked = GetChildControl<ButtonControl>("isTracked"); | |
devicePosition = GetChildControl<Vector3Control>("devicePosition"); | |
deviceRotation = GetChildControl<QuaternionControl>("deviceRotation"); | |
trigger = GetChildControl<AxisControl>("trigger"); | |
// 省略... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment