Question by
younhoffie · Jan 06, 2018 at 10:43 PM ·
error message
how do i fix this its not knownig UpdateUI
public class InventoryUI : MonoBehaviour {
public Transform itemsParent;
Inventory inventory; // Our current inventory
InventorySlot[] slots;
void Start()
{
inventory = Inventory.instance;
inventory.OnItemChangedCallback += UpdateUI;
slots = GetComponentsInChildren<InventorySlot>();
}
void Update()
{
{
// Loop through all the slots
for (int i = 0; i < slots.Length; i++)
{
if (i < inventory.items.Count) // If there is an item to add
{
slots[i].AddItem(inventory.items[i]); // Add it
}
else
{
// Otherwise clear the slot
slots[i].ClearSlot();
}
}
}
void UpdateUI () {
Debug.Log("UPDATING UI");
}
}
}
Comment