void Update() { if (player.gamePaused) { Inventory i = inventory.GetInventory(); int count = inventory.GetInventory().length(); int rowCount = 0; int columnCount = 0; foreach (InventoryItem x in i.GetList()) { if (rowCount < 5) { ++rowCount; } else { rowCount = 0; ++columnCount; } } Background.enabled = true; foreach (InventoryItem x in i.GetList()) { if (x._Name == "Blue Keycard") { KeyBlue.SetActive(true); } } } else { Background.enabled = false; KeyBlue.SetActive(false); KeyRed.SetActive(false); KeyYellow.SetActive(false); } }
public void doOpenClose() { if (KEY == null) { open = !open; anim.SetBool("open", open); return; } Inventory i = playerInventory.GetInventory(); if (!i.HasItem(KEY)) { GetComponent <AudioSource>().Play(); return; } open = !open; anim.SetBool("open", open); }