public void setInventory(TezInventory inventory) { if (m_Inventory != null && m_Inventory.tryGet(out var old_inventory)) { old_inventory.onItemAdded -= this.onItemAdded; old_inventory.onItemRemoved -= this.onItemRemoved; m_Inventory.close(); } this.resetSlots(); m_Inventory = inventory; inventory.onItemAdded += onItemAdded; inventory.onItemRemoved += onItemRemoved; }
public virtual void close() { m_InventoryRef.close(); m_InventoryRef = null; m_FilterManager.close(); m_FilterManager = null; }