Ejemplo n.º 1
0
    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);
        }
    }
Ejemplo n.º 2
0
 private void UpdateInvetory()
 {
     RepairItemsManager.Update();
 }
Ejemplo n.º 3
0
 private void OnEnable()
 {
     RepairItemsManager.AddItem(this);
     count = 0;
 }