Пример #1
0
 public override void enterMenu()
 {
     menuContainer.SetActive(true);
     foreach (Animal a in Farm.getAnimals())
     {
         GameObject g = Instantiate(animalTile) as GameObject;
         g.transform.SetParent(animalList.transform, false);
         AnimalPanelScript p = g.GetComponent <AnimalPanelScript>();
         p.initializePanel(a);
         g.name = ("Panel - " + a.getID());
         animalPanels.Add(p);
     }
 }
Пример #2
0
    public override void refreshMenu()
    {
        foreach (Transform child in animalList.transform)
        {
            GameObject.Destroy(child.gameObject);
        }

        foreach (Animal a in Farm.getAnimals())
        {
            GameObject g = Instantiate(animalTile) as GameObject;
            g.transform.SetParent(animalList.transform, false);
            AnimalPanelScript p = g.GetComponent <AnimalPanelScript>();
            p.initializePanel(a);
            g.name = ("Panel - " + a.getID());
        }
    }
Пример #3
0
    public override void enterMenu()
    {
        menuContainer.SetActive(true);
        LocationProfileNametag.text = CowAppScript.currentFocusLocation.getName();

        if (CowAppScript.currentFocusLocation.getAnimalsAtLocation() != null)
        {
            foreach (Animal a in CowAppScript.currentFocusLocation.getAnimalsAtLocation())
            {
                GameObject g = Instantiate(animalTile) as GameObject;
                g.transform.SetParent(animalsAtLocationList.transform, false);
                AnimalPanelScript p = g.GetComponent <AnimalPanelScript>();
                p.initializePanel(a);
                g.name = ("Panel - " + a.getName());
            }
        }
    }
Пример #4
0
    private void enterFamilyTab()
    {
        familyTab.SetActive(true);

        if (CowAppScript.currentFocusAnimal.getMother() != null)
        {
            motherText.text = CowAppScript.currentFocusAnimal.getMother().getName();
        }
        if (CowAppScript.currentFocusAnimal.getFather() != null)
        {
            fatherText.text = CowAppScript.currentFocusAnimal.getFather().getName();
        }

        foreach (Animal a in CowAppScript.currentFocusAnimal.getChildren())
        {
            GameObject g = Instantiate(animalTile) as GameObject;
            g.transform.SetParent(childPanel.transform, false);
            AnimalPanelScript p = g.GetComponent <AnimalPanelScript>();
            p.initializePanel(a);
            g.name = ("Panel - " + a.getID());
        }
    }