public override void enterMenu() { menuContainer.SetActive(true); foreach (Location l in Farm.getLocations()) { GameObject g = Instantiate(locationTile) as GameObject; g.transform.SetParent(locationList.transform, false); LocationPanelScript p = g.GetComponent <LocationPanelScript>(); p.initializePanel(l); g.name = ("Panel - " + l.getName()); } }
public override void refreshMenu() { foreach (Transform child in locationList.transform) { GameObject.Destroy(child.gameObject); } foreach (Location l in Farm.getLocations()) { GameObject g = Instantiate(locationTile) as GameObject; g.transform.SetParent(locationList.transform, false); LocationPanelScript p = g.GetComponent <LocationPanelScript>(); p.initializePanel(l); g.name = ("Panel - " + l.getName()); } }