public void RemoveBuff(GameBuff buff, bool allLayCount = true) { GameBuffContainer _buffContainer = m_ownBuffs.Find(x => x.info.buff == buff); if (_buffContainer != null) { if (!allLayCount) { _buffContainer.info.layCount--; } else { m_ownBuffs.Remove(_buffContainer); } } }
public void AddBuff(GameBuff buff) { GameBuffContainer _buffContainer = m_ownBuffs.Find(x => x.info.buff == buff); if (_buffContainer != null) { _buffContainer.info.layCount++; _buffContainer.info.remainingTime = buff.ExistTime; } else { m_ownBuffs.Add(new GameBuffContainer(new GameBuffContainer.BuffInfo() { buff = buff, layCount = 1, remainingTime = buff.ExistTime, owner = m_owner })); m_ownBuffs[m_ownBuffs.Count - 1].OnBuffTimeUp += RemoveBuff; m_ownBuffs[m_ownBuffs.Count - 1].Active(); } }