public void Tick(float deltaTime) { for (int i = 0; i < buffList.Count; i++) { buffList[i].Tick(Time.deltaTime); if (buffList[i].IsEnded()) { buffList.RemoveAt(i); OnBuffsChanged?.Invoke(this, EventArgs.Empty); return; } } }
public void AddBuff(Buff buff) { for (int i = 0; i < buffList.Count; i++) { if (buffList[i].TypeValue == buff.TypeValue) { buffList[i].Stack(); return; } } buff.SetTargetUnit(unit); buffList.Add(buff); buff.Begin(); OnBuffsChanged?.Invoke(this, EventArgs.Empty); }