Example #1
0
 void Update()
 {
     if (VRInput.GetDown(GenericVRButton.Index, handedness))
     {
         Shoot();
     }
 }
Example #2
0
 private void Update()
 {
     if (VRInput.GetDown(GenericVRButton.Hand, handedness))
     {
         Grab();
     }
     else if (VRInput.GetUp(GenericVRButton.Hand, handedness))
     {
         Drop();
     }
 }
 public void CheckForUse()
 {
     if (inputIsDiscrete && VRInput.GetDown(useButton, handedness))
     {
         onUse.Invoke();
     }
     else if (!inputIsDiscrete && VRInput.Get(useButton, handedness))
     {
         onUse.Invoke();
     }
 }
Example #4
0
    private Queue <Vector3> velocityInputs = new Queue <Vector3>(); //calculate to handle throwing


    private void Update()
    {
        UpdateVelocity();
        print(velocityInputs);

        if (VRInput.GetDown(GenericVRButton.Hand, handedness))
        {
            Grab();
        }
        else if (VRInput.GetUp(GenericVRButton.Hand, handedness))
        {
            Drop();
        }
    }
Example #5
0
    private void Update()
    {
        UpdateVelocity();

        if (VRInput.GetDown(GenericVRButton.Hand, handedness))
        {
            Grab();
        }
        else if (VRInput.GetUp(GenericVRButton.Hand, handedness))
        {
            Drop();
        }

        if (grabbedComponent)
        {
            grabbedComponent.CheckForUse();
        }
    }