void Start() { TriggerAction.AddOnStateDownListener(OnTriggerButtonDown, RightHandInputSource); TriggerPullAction.AddOnChangeListener(OnTriggerPull, RightHandInputSource); TriggerAction.AddOnStateDownListener(OnTriggerButtonDown, LeftHandInputSource); //TriggerAction.AddOnStateUpListener(OnTriggerButtonDown, LeftHandInputSource); TriggerPullAction.AddOnChangeListener(OnTriggerPull, LeftHandInputSource); }
public void OnEnable() { if (ApplyForceAction == null) { return; } ApplyForceAction.AddOnChangeListener(OnAxisValueChanged, Hand); }
// Start is called before the first frame update private void Start() { boost.AddOnChangeListener(ActionBoostChange, SteamVR_Input_Sources.LeftHand); forwardThrust.AddOnChangeListener(ActionForwardThrustChange, SteamVR_Input_Sources.LeftHand); hvThrust.AddOnChangeListener(ActionHvThrustChange, SteamVR_Input_Sources.LeftHand); grabJoystick.AddOnChangeListener(ActionGrabJoystickChange, SteamVR_Input_Sources.RightHand); uiEnter.AddOnChangeListener(ActionUiEnterChange, SteamVR_Input_Sources.RightHand); uiBack.AddOnChangeListener(ActionUiBackChange, SteamVR_Input_Sources.RightHand); pitchRoll.AddOnChangeListener(ActionPitchRollChange, SteamVR_Input_Sources.RightHand); gripLeft.AddOnChangeListener(ActionGripLeftChange, SteamVR_Input_Sources.LeftHand); gripRight.AddOnChangeListener(ActionGripRightChange, SteamVR_Input_Sources.RightHand); }
private void OnEnable() { if (hand == null) { hand = this.GetComponent <Hand>(); } if (gripAction == null) { Debug.LogError("<b>[SteamVR Interaction]</b> No grab action assigned"); return; } if (triggerAction == null) { Debug.LogError("<b>[SteamVR Interaction]</b> No grab action assigned"); } triggerAction.AddOnChangeListener(OnTriggerActionChange, hand.handType); gripAction.AddOnChangeListener(OnGripActionChange, hand.handType); }