示例#1
0
        /// <summary>
        /// Init properties
        /// </summary>
        protected virtual void Init()
        {
            fighter = gameObject.GetMeleeFighter();
            ///Initialize all bodyMembers and weapons
            foreach (vBodyMember member in Members)
            {
                ///damage of member will be always the defaultDamage
                //member.attackObject.damage = defaultDamage;
                member.attackObject.damage.damageValue = defaultDamage.damageValue;
                if (member.bodyPart == HumanBodyBones.LeftLowerArm.ToString())
                {
                    var weapon = member.attackObject.GetComponentInChildren <vMeleeWeapon>(true);
                    leftWeapon = weapon;
                }
                if (member.bodyPart == HumanBodyBones.RightLowerArm.ToString())
                {
                    var weapon = member.attackObject.GetComponentInChildren <vMeleeWeapon>(true);
                    rightWeapon = weapon;
                }
                member.attackObject.meleeManager = this;
                member.SetActiveDamage(false);
            }

            if (leftWeapon != null)
            {
                leftWeapon.SetActiveDamage(false);
                leftWeapon.meleeManager = this;
            }
            if (rightWeapon != null)
            {
                rightWeapon.meleeManager = this;
                rightWeapon.SetActiveDamage(false);
            }
        }
示例#2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="weaponObject"></param>
 public void SetRightWeapon(vMeleeWeapon weapon)
 {
     if (weapon)
     {
         rightWeapon = weapon;
         rightWeapon.meleeManager = this;
         rightWeapon.SetActiveDamage(false);
     }
 }
示例#3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="weaponObject"></param>
 public void SetLeftWeapon(vMeleeWeapon weapon)
 {
     if (weapon)
     {
         leftWeapon = weapon;
         leftWeapon.SetActiveDamage(false);
         leftWeapon.meleeManager = this;
     }
 }
示例#4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="weaponObject"></param>
 public void SetLeftWeapon(GameObject weaponObject)
 {
     if (weaponObject)
     {
         leftWeapon = weaponObject.GetComponent <vMeleeWeapon>();
         if (leftWeapon)
         {
             leftWeapon.SetActiveDamage(false);
             leftWeapon.meleeManager = this;
         }
     }
 }
示例#5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="weaponObject"></param>
 public virtual void SetLeftWeapon(GameObject weaponObject)
 {
     if (weaponObject)
     {
         leftWeapon = weaponObject.GetComponent <vMeleeWeapon>();
         SetLeftWeapon(leftWeapon);
     }
     else
     {
         leftWeapon = null;
     }
 }
示例#6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="weaponObject"></param>
 public virtual void SetRightWeapon(vMeleeWeapon weapon)
 {
     if (weapon)
     {
         onEquipWeapon.Invoke(weapon.gameObject, false);
         rightWeapon = weapon;
         rightWeapon.meleeManager = this;
         rightWeapon.SetActiveDamage(false);
     }
     else
     {
         rightWeapon = null;
     }
 }
示例#7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="weaponObject"></param>
 public virtual void SetLeftWeapon(vMeleeWeapon weapon)
 {
     if (weapon)
     {
         onEquipWeapon.Invoke(weapon.gameObject, true);
         leftWeapon = weapon;
         leftWeapon.SetActiveDamage(false);
         leftWeapon.meleeManager = this;
     }
     else
     {
         leftWeapon = null;
     }
 }