void UpdatePickups() { int activeCount = 0; int staticCount = 0; for (int i = 0; i < PlayerManager.Instance.player.ownedItems.Count; i++) { ItemBase item = PlayerManager.Instance.player.ownedItems[i]; if (!item.autoUse) { bool isUsingLast = item.State == ItemBase.ItemState.Using && item.ownedCount == 1; if (!isUsingLast && item.ownedCount > 0) { UIActivablePickup pick = GetActivableAt(activeCount); pick.Setup(item); pick.gameObject.SetActive(true); activeCount++; } } else { UIStaticPickup pick = GetStaticAt(staticCount); pick.Setup(item); pick.gameObject.SetActive(true); staticCount++; } } for (int i = activeCount; i < activablesParent.childCount; i++) { activablesParent.GetChild(i).gameObject.SetActive(false); } for (int i = staticCount; i < staticParent.childCount; i++) { staticParent.GetChild(i).gameObject.SetActive(false); } }