Example #1
0
        //设置服务器列表
        void setServerList()
        {
            SelServerItem item;
            int           i = 0;

            foreach (ServerItemData data in ServerListMgr.I.dicServerList.Values)
            {
                if (itemList.Count == i)
                {
                    item = new SelServerItem();
                    item.Instantiate(prefabSelServerItem, gridContent.transform);
                    item.onClick = selectServerItem;
                    itemList.Add(item);
                }
                else
                {
                    item = itemList[i];
                }

                item.SetData(data);

                i++;
            }
        }
Example #2
0
 /// <summary>
 /// 服务器列表Item点击回调事件
 /// </summary>
 /// <param name="item"></param>
 void selectServerItem(SelServerItem item)
 {
     SelSeverURL = item.Data.URL;
     ServerListMgr.I.SetServerId(SelSeverURL);
     CloseSelf();
 }