public void PopulatePanel(List <ItemScriptables> itemList) { WipeChildren(); foreach (ItemScriptables item in itemList) { IconSlot icon = Instantiate(ItemSlotPrefab, RectTransform).GetComponent <IconSlot>(); icon.Initialize(item); } }
public void PopulatePanel(List <ItemScriptable> itemList) { WipeChildren(); foreach (ItemScriptable item in itemList) { Debug.Log("Instantiating"); IconSlot icon = Instantiate(itemSlotPrefab, rectTransform).GetComponent <IconSlot>(); icon.Initialize(item); } }
private void OnCharacterBuffChanged(int buffID, bool isAdding) { if (isAdding) { IconSlot buffSlot = Instantiate(buffSlotPrefab, buffSlotHolder); buffSlot.slotID = buffID; buffSlot.icon.sprite = character.EntityBuffManager.BuffHashes[buffID].GetBaseBuff().sprite; buffSlot.RegisterDisplayAction(OnShowBuffInfoBoardEvent); buffSlot.RegisterHideAction(OnHideInfoBoardEvent); buffSlots.Add(buffSlot); } else { for (int i = 0; i < buffSlots.Count; i++) { buffSlots[i].UpdateSlotID(buffID); } Destroy(buffSlotHolder.GetChild(buffID).gameObject); buffSlots.RemoveAt(buffID); } }