inventory
This commit is contained in:
parent
d2c90c3b7f
commit
66eb5af0bb
2 changed files with 74 additions and 1 deletions
|
|
@ -14,14 +14,20 @@ public class InventoryUI : MonoBehaviour {
|
|||
_inventory.onItemChangedCallback += UpdateUI;
|
||||
|
||||
_slots = itemsParent.GetComponentsInChildren<InventorySlot>();
|
||||
toggleInventory();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update() {
|
||||
if(Input.GetButtonDown("Inventory")) {
|
||||
inventoryUI.SetActive(!inventoryUI.activeSelf);
|
||||
toggleInventory();
|
||||
}
|
||||
}
|
||||
|
||||
private void toggleInventory() {
|
||||
|
||||
inventoryUI.SetActive(!inventoryUI.activeSelf);
|
||||
}
|
||||
|
||||
private void UpdateUI() {
|
||||
for(int i = 0; i < _slots.Length; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue