public void OpenCloseContainer() { if (InventoryPanel == null) { InventoryPanel = UIPanel.InstantiatePanel(InventoryPrefab) as UIInventory; InventoryPanel.CreateInventoryGrid(this); UIManager.Manager.AddPanel(InventoryPanel); } else { UIManager.Manager.RemovePanel(InventoryPanel); InventoryPanel = null; } }