//POPULA O SHOP JÁ CARREGADO NA INTERFACE public void PopulateInterface() { int i = 0; foreach (string key in GlobalVars.shopCache.lists.Keys) { ShopItemList list = GlobalVars.shopCache.lists[key]; GameObject go = Instantiate(listPrefab); go.transform.SetParent(content.transform, false); ShopItemListUI listUI = go.GetComponent <ShopItemListUI>(); listUI.listName = list.listName; RectTransform rect = go.GetComponent <RectTransform>(); rect.offsetMin = new Vector2(0, -initialListY - 200 - listPeriod * i); rect.offsetMax = new Vector2(0, -initialListY + 200 - listPeriod * i); int j = 0; float size = 300; foreach (ShopItem item in list.items) { GameObject go2 = Instantiate(itemPrefab); go2.transform.SetParent(listUI.content.transform, false); ShopItemUI itemUI = go2.GetComponent <ShopItemUI>(); itemUI.LoadShopItem(item); itemUI.canvas = canvas; RectTransform rect2 = go2.GetComponent <RectTransform>(); rect2.offsetMin = new Vector2(j * size, 100); rect2.offsetMax = new Vector2(size + j * size, -100); RectTransform listContentRect = listUI.content.GetComponent <RectTransform>(); listContentRect.offsetMax = new Vector2(listContentRect.offsetMax.x + size, 100); j++; } i++; } }