Beispiel #1
0
 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());
     }
 }
Beispiel #2
0
    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());
        }
    }