private List <GameObject> WorkshopToGameObject(List <IWorkshop> workshops) { List <GameObject> objectList = new List <GameObject>(); for (int i = 0; i < workshops.Count; i++) { GameObject obj = Instantiate(workshopDisplay, simpleMenu.GetContent()); IWorkshop workshop = workshops[i]; obj.GetComponent <WorkshopUI>().Display(workshop, traderUI.GetTrader(), settlement); objectList.Add(obj); } return(objectList); }
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"); }