Example #1
0
 private void addElments()
 {
     for (int i = 0; i < Config.getCount(); i++)
     {
         SkyElementBase element = Instantiate(BaseElement) as SkyElementBase;
         element.transform.SetParent(myScrollList.gameObject.transform, false);
         element.Init(i, this);
     }
 }
Example #2
0
 private void addElments()
 {
     ElementButtons.Clear();
     for (int i = 0; i < Config.GetCount(); i++)
     {
         SkyElementBase element = Instantiate(BaseElement) as SkyElementBase;
         element.transform.SetParent(myScrollList.gameObject.transform, false);
         if (!element.Init(i, this))
         {
             Destroy(element.gameObject);
         }
         else
         {
             if (element.GetComponent <Button>() != null)
             {
                 ElementButtons.Add(element.GetComponent <Button>());
             }
         }
     }
 }