| | |
| | | using Assets.Scripts.Enums; |
| | | using Assets.Scripts.Helpers; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | |
| | | public GameObject itemNameDescription; |
| | | public GameObject itemDescription; |
| | | public GameObject itemDeleteButton; |
| | | public GameObject inventoryMaxAmount; |
| | | |
| | | public List<GameObject> itemUIs = new List<GameObject>(); |
| | | |
| | |
| | | //} |
| | | if (context.started) |
| | | { |
| | | inventoryPanel.SetActive(!inventoryPanel.activeSelf); |
| | | if (inventoryPanel.activeSelf) |
| | | { |
| | | UpdateItemContentList(); |
| | | } |
| | | else |
| | | { |
| | | //ClearItemContentList(); |
| | | } |
| | | ToggleInventoryPanel(); |
| | | } |
| | | } |
| | | |
| | | public void ToggleInventoryPanel() |
| | | { |
| | | inventoryPanel.SetActive(!inventoryPanel.activeSelf); |
| | | if (inventoryPanel.activeSelf) |
| | | { |
| | | UpdateItemContentList(); |
| | | } |
| | | else |
| | | { |
| | | //ClearItemContentList(); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | private void UpdateItemContentList() |
| | | { |
| | | TextMeshProHelper.UpdateItemMaxCountText(inventoryMaxAmount.GetComponent<TextMeshProUGUI>(), inventory.items.Count, inventory.maxInventorySize); |
| | | |
| | | // First, deactivate all existing itemUIs |
| | | itemUIs.ForEach(itemUI => itemUI.SetActive(false)); |
| | | |