示例#1
0
 public VRHitInfo(VRMeleeAttackObject attackObject, VRHitBox hitBox, Collider targetCollider, Vector3 hitPoint)
 {
     this.attackObject   = attackObject;
     this.hitBox         = hitBox;
     this.targetCollider = targetCollider;
     this.hitPoint       = hitPoint;
 }
示例#2
0
    /// <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);
    }
示例#3
0
    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);
        }
    }