public void OnItemsChanged() { // Destroy existing items. foreach (Transform oldItem in transform) { Destroy(oldItem.gameObject); } // Get current owned items. List <RepairItem> ownedItems = RepairItemsManager.GetAllOwnedItems(); // Add the current owned items to the inventory. foreach (RepairItem item in ownedItems) { //TODO: Add object count as well. InvetoryImage newImage = Instantiate(invetoryImagePrefab, transform); newImage.SetUp(item.itemSprite, item.count); } }
private void UpdateInvetory() { RepairItemsManager.Update(); }
private void OnEnable() { RepairItemsManager.AddItem(this); count = 0; }