public void Refresh()
 {
     foreach (Item indexedItem in this.inventory.items)
     {
         Debug.Log("Item in inventory -> " + indexedItem.name);
         ItemUI ui = ItemUI.Instantiate(itemUIPrefab, this.content);
         ui.Display(indexedItem);
     }
 }
示例#2
0
    public virtual void Refresh()
    {
        foreach (Transform t in content)
        {
            Destroy(t.gameObject);
        }

        foreach (Item i in inventory.Items)
        {
            ItemUI ui = Instantiate(itemUIPrefab, content);
            ui.onClicked.AddListener(UIClicked);
            ui.Display(i);
        }
    }