Exemple #1
0
    public void Apply(StatusEffects target)
    {
        switch (type)
        {
        case EffectsType.Slow:
            target.Slow(value);
            break;

        case EffectsType.Stun:
            //  Debug.Log("stunning");
            target.Stun();
            break;

        case EffectsType.PhysicalAttack:
            target.ChangePhysicalDamage(value, duration);
            break;

        case EffectsType.MagicalAttack:
            target.ChangeMagDmg(value, duration);
            break;

        default:
            break;
        }

        if (target.isActiveAndEnabled)
        {
            target.StartCoroutine(Unapply(target));
        }
    }