void Update() { if (Input.GetKeyDown(KeyCode.I)) { if (!InventoryCaneva.panel.gameObject.activeInHierarchy) { InventoryCaneva.OpenInventory(Items); } else { if (CraftUI.isActive) { CraftUI.StaticExit(); } InventoryCaneva.Exit(); } } if (Input.GetKeyDown(KeyCode.C) && InventoryCaneva.panel.gameObject.activeInHierarchy) { if (!CraftUI.isActive) { CraftUI.OpenCraftingUI(); } else { CraftUI.StaticExit(); } } }
public void Exit() { if (CraftUI.isActive) { CraftUI.StaticExit(); } panel.SetActive(false); panelPlayer.SetActive(false); _lastSelectedItem = -1; }