Esempio n. 1
0
 public void addItem(List <string> mes)
 {
     for (int i = 0; i < mes.Count; i++)
     {
         GameObject     o     = GameObject.Instantiate(item) as GameObject;
         FamilyShopCell fcell = o.GetComponent <FamilyShopCell>();
         o.SetActive(true);
         o.transform.parent     = grid.transform;
         o.transform.localScale = new Vector3(1, 1, 1);
         string []  str = mes[i].Split(';');
         UILabel [] las = o.GetComponentsInChildren <UILabel>();
         for (int j = 0; j < las.Length; j++)
         {
             if (las[j].name.Equals("TimeLabel"))
             {
                 las[j].text = str[0];
             }
             if (las[j].name.Equals("jiluLabel"))
             {
                 las[j].text = str[1];
             }
         }
         itemlist.Add(o);
         grid.repositionNow = true;
     }
 }
Esempio n. 2
0
    public void UpdateGuildShop(COM_GuildShopItem [] itemids)
    {
        for (int i = 0; i < 6; i++)
        {
            GameObject     o     = GameObject.Instantiate(item) as GameObject;
            FamilyShopCell fcell = o.GetComponent <FamilyShopCell>();
            o.SetActive(true);
            o.transform.parent     = grid.transform;
            o.transform.localScale = new Vector3(1, 1, 1);
            if (i < itemids.Length)
            {
                HomeShopData hdata = HomeShopData.GetHomeShopData(itemids[i].shopId_);
                fcell.HShopItem = itemids[i];
                UIManager.SetButtonEventHandler(o, EnumButtonEvent.OnClick, buttonClick, itemids[i].shopId_, itemids[i].buyLimit_);
            }
            else
            {
                fcell.HideUI(i);
            }

            grid.repositionNow = true;
        }
    }