private void OnReleased(HVRGrabberBase arg0, HVRGrabbable arg1) { if (RecoilComponent) { RecoilComponent.HandRigidBody = null; } }
public void UnregisterGrabber(HVRGrabberBase grabber) { if (GrabberManager) { GrabberManager.UnregisterGrabber(grabber); } }
private void OnGrabbed(HVRGrabberBase arg0, HVRGrabbable arg1) { if (arg0 is HVRHandGrabber hand && RecoilComponent) { RecoilComponent.HandRigidBody = hand.Rigidbody; } }
protected void OnReleased(HVRGrabberBase grabber, HVRGrabbable hvrGrabbable) { if (DiscardAngle) { transform.rotation = RotationTarget.rotation; transform.position = RotationTarget.position; } }
protected override void OnReleased(HVRGrabberBase grabber) { base.OnReleased(grabber); if (_emptyPushedBack) { return; } Close(); }
private void OnStabilizerReleased(HVRGrabberBase grabber, HVRGrabbable arg1) { Grabbable.ForceTwoHandSettings = false; if (RecoilComponent) { RecoilComponent.TwoHanded = false; } }
private void OnStabilizerGrabbed(HVRGrabberBase grabber, HVRGrabbable arg1) { if (Grabbable.PrimaryGrabber && Grabbable.PrimaryGrabber.IsHandGrabber) { Grabbable.ForceTwoHandSettings = true; if (RecoilComponent) { RecoilComponent.TwoHanded = true; } } }
protected override void OnGrabbed(HVRGrabberBase grabber) { grabber.ForceRelease(); if (Arrow) { grabber.AllowGrabbing = false; this.ExecuteNextUpdate(() => { grabber.TryGrab(Arrow, true); grabber.AllowGrabbing = true; }); } }
private void OnReleased(HVRGrabberBase grabber, HVRGrabbable arg1) { if (!grabber.IsHandGrabber) { return; } _handGrabber = null; if (ResetOnRelease) { Close(); } }
private void OnGrabbed(HVRGrabberBase grabber, HVRGrabbable arg1) { if (!grabber.IsHandGrabber) { return; } _handGrabber = grabber as HVRHandGrabber; //HandCheckAnchor.transform.localPosition = PumpGrabbable.transform.InverseTransformPoint(_handGrabber.GrabPoint.position); HandCheckAnchor.transform.position = _handGrabber.GrabPoint.position; _previousHandPosition = _handGrabber.TrackedController.position; _previousVelocity = Vector3.zero; }
protected virtual void OnArrowSocketed(HVRGrabberBase arg0, HVRGrabbable grabbable) { var arrow = grabbable.transform.GetComponent <HVRArrow>(); if (!arrow) { NockHand = null; Debug.LogWarning($"{grabbable.name} missing HVRArrow component."); return; } OnArrowNocked(arrow); }
protected void OnReleased(HVRGrabberBase grabber, HVRGrabbable hvrGrabbable) { PrimaryGrabber = null; if (DiscardAngle) { if (_rigidBody) { _rigidBody.MoveRotation(RotationTarget.rotation); } else { transform.localRotation = RotationTarget.localRotation; } } }
private void OnGrabbableActivated(HVRGrabberBase arg0, HVRGrabbable arg1) { if (!CanFire()) { OnOutofAmmo(); return; } if (FireType == FireType.Single) { if (_timer < Cooldown) { return; } _timer = 0f; OnFired(); AfterFired(); return; } if (FireType == FireType.Automatic) { _isFiring = true; if (_automaticRoutine != null) { StopCoroutine(_automaticRoutine); } _automaticRoutine = StartCoroutine(Automatic()); return; } if (FireType == FireType.Burst) { if (_timer < Cooldown) { return; } _timer = 0f; } }
protected virtual void OnAmmoGrabbed(HVRGrabberBase grabber, HVRGrabbable grabbable) { var ammo = grabbable.GetComponent <HVRAmmo>(); if (!ammo) { Debug.Log($"{grabbable.name} is missing the ammo component."); return; } Ammo = ammo; foreach (var ourCollider in Grabbable.Colliders) { foreach (var ammoCollider in grabbable.Colliders) { Physics.IgnoreCollision(ourCollider, ammoCollider, true); } } }
public void RegisterGrabber(HVRGrabberBase grabber) { grabber.BeforeGrabbed.AddListener(OnBeforeGrabberGrabbed); grabber.Grabbed.AddListener(OnGrabberGrabbed); grabber.Released.AddListener(OnGrabberReleased); }
protected virtual void OnGrabbableDeactivated(HVRGrabberBase arg0, HVRGrabbable arg1) { _isFiring = false; }
private void OnGrabbed(HVRGrabberBase arg0, HVRGrabbable arg1) { Flying = false; }
protected override void OnGrabbed(HVRGrabberBase grabber) { _emptyPushedBack = false; base.OnGrabbed(grabber); GrabbedPositionTracker.transform.localPosition = transform.InverseTransformPoint(grabber.transform.position); }
protected virtual void OnReleased(HVRGrabberBase arg0, HVRGrabbable arg1) { }
private void BeforeNockHovered(HVRGrabberBase grabber, HVRGrabbable grabbable) { NockHand = grabbable.PrimaryGrabber as HVRHandGrabber; }
public void UnregisterGrabber(HVRGrabberBase grabber) { grabber.Grabbed.RemoveListener(OnGrabberGrabbed); grabber.Released.RemoveListener(OnGrabberReleased); }
protected virtual void OnNockedArrowGrabbed(HVRGrabberBase arg0, HVRGrabbable arg1) { OnArrowDropped(); }
protected virtual void OnGrabberGrabbed(HVRGrabberBase grabber, HVRGrabbable grabbable) { }
protected override void OnReleased(HVRGrabberBase grabber) { base.OnReleased(grabber); Close(); }