public void RemoveItem(BagItem bagItem, bool temporary) { if (bagItems.Contains(bagItem)) { foreach (GridPos gp in bagItem.RealPositionsInBagPanel_BeforeMove) { bagGridMatrix[gp.x, gp.z].State = temporary ? BagGrid.States.TempUnavailable : BagGrid.States.Available; } if (!temporary) { bagItems.Remove(bagItem); bagItem.PoolRecycle(); } } }