- 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
25 lines
754 B
C#
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));
|
|
}
|
|
}
|
|
} |