Exemplo n.º 1
0
        public void ChargedMeleeAttack(float chargedPercent)
        {
            var package = AttackPackage.CreateNewPackage();

            package._faction              = Faction.Player;
            package._attackType           = AttackType.ChargedMelee;
            package._hitPointDamage.Base  = _state._hitPointDamage;
            package._enduranceDamage.Base = _state._enduranceDamage;
            package._chargedPercent.Base  = chargedPercent;
            OnRaisingAttack?.Invoke(sword, chargedMeleeMove);

            sword.Activate(package, chargedMeleeMove);

            _audio.clip = _normalMeleeSFX.PickRandom();
            _audio.Play();
        }
Exemplo n.º 2
0
        public void MeleeAttack()
        {
            var package = AttackPackage.CreateNewPackage();

            package._faction              = Faction.Player;
            package._attackType           = AttackType.Melee;
            package._hitPointDamage.Base  = _state._hitPointDamage;
            package._enduranceDamage.Base = _state._enduranceDamage;
            OnRaisingAttack?.Invoke(sword, meleeMove);

            sword.Activate(package, meleeMove);

            if (_currentAttackEffect)
            {
                return;
            }
            _currentAttackEffect = Instantiate(_attackEffectPrefab);
            _currentAttackEffect.transform.SetParent(sword.transform);
            _currentAttackEffect.transform.localPosition = Vector3.zero;

            _audio.clip = _normalMeleeSFX.PickRandom();
            _audio.Play();
        }