public void DisplayResorces() { simpleMenu.CloseWindow(); if (trader == null) { return; } List <string> resources = trader.GetResources(); List <ColapsedObject <string> > colapsedResources = UiMethods.ColapseResources(resources); List <GameObject> objectList = new List <GameObject>(); for (int i = 0; i < colapsedResources.Count; i++) { GameObject obj = Instantiate(resourceTemp, simpleMenu.GetContent()); obj.GetComponent <ResourceUI>().Display(colapsedResources[i].ammount + "x " + colapsedResources[i].obj); objectList.Add(obj); } simpleMenu.Display(objectList, "Storage"); }