Пример #1
0
 // Update is called once per frame
 void Update()
 {
     //Debug.Log("TRIGGER PRESENT");
     if (controller == null)
     {
         controller = GameObject.Find("RightHand").transform.GetChild(2).GetComponent <VRTK_ControllerEvents>();
         if (controller != null)
         {
             controller.GripPressed  += BoardObjectUsed;
             controller.GripReleased += BoardObjectUnused;
         }
     }
     if (controller != null)
     {
         //Debug.Log($"Trigger Axis {Input.GetAxis("RightTrigger")}");
         if (!triggered && Input.GetAxisRaw("RightTrigger") > 0.5)
         {
             triggered = true;
             controller.OnGripPressed(new ControllerInteractionEventArgs());
         }
         if (triggered && Input.GetAxisRaw("RightTrigger") < 0.5)
         {
             triggered = false;
             controller.OnGripReleased(new ControllerInteractionEventArgs());
         }
     }
 }
Пример #2
0
 public void GripReleased()
 {
     controllerEvents?.OnGripReleased(new ControllerInteractionEventArgs());
 }