예제 #1
0
 public void DisplayThePerson()
 {
     for (int i = 0; i < social.Popu.Count; i++)
     {
         GameObject newperson = Instantiate(personBtn);
         PersonBtn  theperson = newperson.GetComponent <PersonBtn>();
         theperson.transform.localScale = new Vector3(1, 1, 1);
         theperson.transform.SetParent(Grid.transform);
         theperson.transform.localScale = new Vector3(1, 1, 1);
         theperson.text.text            = social.Popu[i].lastname + " " + social.Popu[i].firstname;
         theperson.PersonNum            = social.Popu[i].PersonNum;
         Popu.Add(newperson);
     }
     Grid.GetComponent <UIGrid>().Reposition();
 }
예제 #2
0
    void putTheFamiliersToList(List <Person> Familiers, List <GameObject> _FamList, GameObject thegrid)
    {
        for (int i = 0; i < Familiers.Count; i++)
        {
            if (Familiers[i] != null)
            {
                GameObject familier = Instantiate(personBtn);
                familier.transform.SetParent(thegrid.transform);

                familier.transform.localScale = new Vector3(1, 1, 1);

                PersonBtn theperson = familier.GetComponent <PersonBtn>();
                theperson.text.text = Familiers[i].lastname + " " + Familiers[i].firstname;
                theperson.PersonNum = Familiers[i].PersonNum;

                _FamList.Add(familier);
            }
        }
    }