Example #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);
     }
 }
Example #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());
        }
    }
    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());
            }
        }
    }
Example #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());
        }
    }