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