/// <summary> /// Update the UI values based on the current inventory state. /// </summary> void UpdateUI() { foreach (ThrowableManager throwable in throwables) { if (throwable.IsEquipped()) { if (throwable.IsDiscovered()) { throwable.UpdateButton(); } else { throwable.CreateButton(); } } } //Only need to update keys if a new key has been found. foreach (KeyManager key in keys) { if (PlayerItems.Find("key", key.ID) && !key.Discovered()) { key.CreateImage(); } } }
/// <summary> /// Check if at least one throwable is present in the inventory. /// </summary> /// <returns></returns> public bool IsEquipped() { return(PlayerItems.Find("throwable", throwable.name) || button != null); }