private void GrabInteractedObject() { if (controllerAttachJoint == null && grabbedObject == null && IsObjectGrabbable(interactTouch.GetTouchedObject())) { InitGrabbedObject(); SnapObjectToGrabToController(grabbedObject); } }
void UseInteractedObject() { if (usingObject == null && IsObjectUsable(interactTouch.GetTouchedObject())) { usingObject = interactTouch.GetTouchedObject(); OnControllerUseInteractableObject(interactTouch.SetControllerInteractEvent(usingObject)); usingObject.GetComponent <SteamVR_InteractableObject>().StartUsing(this.gameObject); if (hideControllerOnUse) { trackedController.ToggleControllerModel(false); } } }
void GrabInteractedObject() { if (controllerAttachJoint == null && grabbedObject == null && IsObjectGrabbable(interactTouch.GetTouchedObject())) { grabbedObject = interactTouch.GetTouchedObject(); OnControllerGrabInteractableObject(interactTouch.SetControllerInteractEvent(grabbedObject)); grabbedObject.GetComponent <SteamVR_InteractableObject>().Grabbed(this.gameObject); if (hideControllerOnGrab) { trackedController.ToggleControllerModel(false); } SnapObjectToGrabToController(grabbedObject); } }
private void GrabInteractedObject() { if (grabbedObject == null && IsObjectGrabbable(interactTouch.GetTouchedObject())) { grabbedObject = interactTouch.GetTouchedObject(); OnControllerGrabInteractableObject(interactTouch.SetControllerInteractEvent(grabbedObject)); grabbedObject.GetComponent <SteamVR_InteractableObject>().Grabbed(this.gameObject); if (hideControllerOnGrab) { controllerActions.ToggleControllerModel(false); } Debug.Log("Grabbed"); startWorld = world.transform.position; startPos = trackedController.transform.position; } }
private void DoStartUseObject(object sender, ControllerClickedEventArgs e) { GameObject touchedObject = interactTouch.GetTouchedObject(); if (touchedObject != null && interactTouch.IsObjectInteractable(touchedObject)) { UseInteractedObject(touchedObject); if (!IsObjectHoldOnUse(usingObject)) { SetObjectUsingState(usingObject, GetObjectUsingState(usingObject) + 1); } } }