/// <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); } }
/// <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(vMeleeWeapon weapon) { if (weapon) { leftWeapon = weapon; leftWeapon.SetActiveDamage(false); leftWeapon.meleeManager = this; } }
/// <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; } } }
/// <summary> /// /// </summary> /// <param name="weaponObject"></param> public virtual void SetLeftWeapon(GameObject weaponObject) { if (weaponObject) { leftWeapon = weaponObject.GetComponent <vMeleeWeapon>(); SetLeftWeapon(leftWeapon); } else { leftWeapon = null; } }
/// <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; } }
/// <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; } }