public Weapon(GenericItem baseItem) : base(baseItem) { GenericWeapon baseWeapon = baseItem as GenericWeapon; animationClip = baseWeapon.animation; damage = baseWeapon.GetDamage(); range = baseWeapon.weaponRange; attackSpeed = baseWeapon.GetAttackspeed(); isRightHanded = baseWeapon.isRightHanded; hitArea = baseWeapon.hitArea; staminaUse = baseWeapon.weaponStaminaConsumption; }
protected override void Initialize() { if (!defaultWeapon) { defaultWeapon = Resources.Load("Prefabs/Unarmed") as GenericWeapon; } Animator animator = GetComponent <Animator>(); Weapon weapon = defaultWeapon.GenerateItem() as Weapon; equipedWeapon = weapon.Equip(transform, rightWeaponHolder, leftWeaponHolder, animator); CalculateInitialStats(weapon); }