void Start()
    {
        TriggerAction.AddOnStateDownListener(OnTriggerButtonDown, RightHandInputSource);
        TriggerPullAction.AddOnChangeListener(OnTriggerPull, RightHandInputSource);

        TriggerAction.AddOnStateDownListener(OnTriggerButtonDown, LeftHandInputSource);
        //TriggerAction.AddOnStateUpListener(OnTriggerButtonDown, LeftHandInputSource);
        TriggerPullAction.AddOnChangeListener(OnTriggerPull, LeftHandInputSource);
    }
Exemplo n.º 2
0
 public void OnEnable()
 {
     if (ApplyForceAction == null)
     {
         return;
     }
     ApplyForceAction.AddOnChangeListener(OnAxisValueChanged, Hand);
 }
Exemplo n.º 3
0
 // 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);
 }
Exemplo n.º 4
0
    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);
    }