/// <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>(); leftWeapon = weapon; } if (member.bodyPart == HumanBodyBones.RightLowerArm.ToString()) { var weapon = member.attackObject.GetComponentInChildren <vMeleeWeapon>(); 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); } }
/// <summary> /// /// </summary> /// <param name="weaponObject"></param> public void SetLeftWeapon(vMeleeWeapon weapon) { if (weapon) { leftWeapon = weapon; leftWeapon.SetActiveDamage(false); leftWeapon.meleeManager = this; } }
/// <summary> /// /// </summary> /// <param name="weaponObject"></param> public void SetRightWeapon(vMeleeWeapon weapon) { if (weapon) { rightWeapon = weapon; rightWeapon.meleeManager = this; rightWeapon.SetActiveDamage(false); } }
/// <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; } } }