RiftMayhem/Assets/Scripts/AbilitySystem/Effects/DamageOverTimeVFXManager.cs
Pedro Gomes a42b1ea784 Massive update on NPCs and damage over time effects
- NPC controller reworked completely
- ability priority list for npc's
- npc's with animations
- damage over time effect added
- burn, poison and bleed over time effects added
2024-07-19 21:57:47 +01:00

25 lines
754 B
C#

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));
}
}
}