29 lines
611 B
C#
29 lines
611 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public abstract class Status : MonoBehaviour
|
|
{
|
|
private Entity entityLinked;
|
|
[SerializeField]
|
|
protected float _duration;
|
|
|
|
private void Start()
|
|
{
|
|
EntityLinked = GetComponent<Entity>();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
// effect timer
|
|
_duration -= Time.deltaTime;
|
|
if ( _duration < 0 ) Unapply();
|
|
}
|
|
|
|
public abstract void Apply(float duration);
|
|
public abstract void Unapply();
|
|
|
|
public Entity EntityLinked { get => entityLinked; set => entityLinked = value; }
|
|
|
|
}
|