public void Update() { if (firearm.IsHeld) { if (firearm.m_hand.OtherHand.CurrentInteractable != null) { if (firearm.m_hand.OtherHand.CurrentInteractable is FVRFireArmRound) { var currentInteractableObject = firearm.m_hand.OtherHand.CurrentInteractable.transform; var num = Vector3.Distance ( currentInteractableObject.position, firearm.GetClosestValidPoint ( carrierComparePoint1.position, carrierComparePoint2.position, currentInteractableObject.position ) ); _mTarCarrierRot = num < carrierDetectDistance ? carrierRots.y : carrierRots.x; } else { _mTarCarrierRot = carrierRots.x; } } else { _mTarCarrierRot = carrierRots.x; } } else { _mTarCarrierRot = carrierRots.x; } if (Mathf.Abs(_mCurCarrierRot - _mTarCarrierRot) > 0.001f) { _mCurCarrierRot = Mathf.MoveTowards ( _mCurCarrierRot, _mTarCarrierRot, 270f * Time.deltaTime ); carrier.transform.localEulerAngles = new Vector3(_mCurCarrierRot, 0f, 0f); } }
public void Update() { if (firearm.IsHeld) { if (firearm.m_hand.OtherHand.CurrentInteractable != null) { if (firearm.m_hand.OtherHand.CurrentInteractable is FVRFireArmRound) { float num = Vector3.Distance(firearm.m_hand.OtherHand.CurrentInteractable.transform.position, firearm.GetClosestValidPoint(this.CarrierComparePoint1.position, this.CarrierComparePoint2.position, firearm.m_hand.OtherHand.CurrentInteractable.transform.position)); if (num < this.CarrierDetectDistance) { this.m_tarCarrierRot = this.CarrierRots.y; } else { this.m_tarCarrierRot = this.CarrierRots.x; } } else { this.m_tarCarrierRot = this.CarrierRots.x; } } else { this.m_tarCarrierRot = this.CarrierRots.x; } } else { this.m_tarCarrierRot = this.CarrierRots.x; } if (Mathf.Abs(this.m_curCarrierRot - this.m_tarCarrierRot) > 0.001f) { this.m_curCarrierRot = Mathf.MoveTowards(this.m_curCarrierRot, this.m_tarCarrierRot, 270f * Time.deltaTime); this.Carrier.transform.localEulerAngles = new Vector3(this.m_curCarrierRot, 0f, 0f); } }