using UnityEngine;

public class DamageOverTimeVFXManager : MonoBehaviour
{
    public GameObject burnVFX;
    public GameObject poisonVFX;
    public GameObject bleedVFX;

    private void Awake()
    {
        SetupEffectInstance<BurnEffectInstance>(burnVFX);
        SetupEffectInstance<PoisonEffectInstance>(poisonVFX);
        SetupEffectInstance<BleedEffectInstance>(bleedVFX);
    }

    private void SetupEffectInstance<T>(GameObject vfx) where T : BaseDamageOverTimeEffectInstance
    {
        T instance = GetComponent<T>();
        if (instance != null)
        {
            instance.OnEffectStackAddedEvent.AddListener(() => vfx.SetActive(true));
            instance.OnEffectEnded.AddListener(() => vfx.SetActive(false));
        }
    }
}