public VRHitInfo(VRMeleeAttackObject attackObject, VRHitBox hitBox, Collider targetCollider, Vector3 hitPoint) { this.attackObject = attackObject; this.hitBox = hitBox; this.targetCollider = targetCollider; this.hitPoint = hitPoint; }
/// <summary> /// Return controller gameobject where was placed attackObject /// </summary> /// <returns></returns> public virtual GameObject GetControllerGameObject(VRMeleeAttackObject attackObject) { if ((rightWeapon != null && attackObject == rightWeapon) || attackObject == rightHand) { return(rightHand.gameObject); } if ((leftWeapon != null && attackObject == leftWeapon) || attackObject == leftHand) { return(leftHand.gameObject); } return(null); }
void CheeckWeapon(VRMeleeAttackObject hand, VRMeleeAttackObject weapon) { // if weapon is active if (weapon != null && weapon.canApplyDamage) { return; } // if weapon not active but not null if (weapon != null) { weapon.SetActiveDamage(true); hand.SetActiveDamage(false); } else if (!hand.canApplyDamage) { hand.SetActiveDamage(true); } }