22 lines
499 B
C#
22 lines
499 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
public class EffectInstance : MonoBehaviour
|
|
{
|
|
public Effect thisEffect;
|
|
public Entity affectedEntity;
|
|
public float timeElapsed;
|
|
private void Update()
|
|
{
|
|
timeElapsed += Time.deltaTime;
|
|
if (timeElapsed > thisEffect.duration)
|
|
{
|
|
thisEffect.RemoveEffect(affectedEntity);
|
|
return;
|
|
}
|
|
if (thisEffect.isConstant)
|
|
{
|
|
thisEffect.EffectTick(affectedEntity);
|
|
}
|
|
}
|
|
}
|