Exemplo n.º 1
0
    private void ApplyHitEffects(Collider2D other, ReceiveHit hitable)
    {
        int   damage   = _weaponSystem.CurrentMeleeAttack.Damage;
        float amount   = _weaponSystem.CurrentMeleeAttack.KnockbackAmount;
        float duration = _weaponSystem.CurrentMeleeAttack.KnockbackDuration;
        // add modifier, adjusted for facing direction
        Vector2 direction = CalculateDirection(other);

        //pushable.Push(direction, amount, duration);
        if (_hitParticle != null)
        {
            ParticleSystem hitParticle = Instantiate(_hitParticle, hitable.transform);
            hitParticle.Play();
        }
        HitData hitData = new HitData(other.transform, damage, direction, amount, duration);

        hitable.Hit(hitData);
    }