예제 #1
0
    public void AddEffect(Status status)
    {
        var existingStatus = statuses.Find(s => s == status);

        if (existingStatus != null)
        {
            existingStatus.expireTime = Mathf.Max(existingStatus.expireTime, status.expireTime);
            return;
        }
        statuses.Add(status);
        status.ApplyEffect(this);
    }
예제 #2
0
    public virtual void ApplyStatusEffects()
    {
        for (int i = 0; i < currentEffects.Count; i++)
        {
            Status status = currentEffects[i];

            status.ApplyEffect();
            //Necessary?
            if (status.IsFinished())
            {
                currentEffects.Remove(status);
            }
        }
    }