public void UpdateInventory()
 {
     Button[] buttons = itemPanel.GetComponentsInChildren <Button>();
     foreach (Button b in buttons)
     {
         Destroy(b.gameObject);
     }
     if (party.InventoryNotEmpty())
     {
         for (int i = 0; i < party.playerInventoryCount.Length; i++)
         {
             if (party.playerInventoryCount[i] > 0)
             {
                 GameObject btn = Instantiate(inventoryButton);
                 InventoryButtonController btnCont = btn.GetComponent <InventoryButtonController>();
                 btnCont.invPanel   = itemPanel;
                 btnCont.invItemNum = i;
             }
         }
     }
 }
示例#2
0
 void Awake()
 {
     Instance = this;
 }