Example #1
0
    private void AddServerItem(UILoginPanel_ServerItem.sItemData serverItemData)
    {
        Transform tmpServerItem            = Transform.Instantiate(_serverItem_Prefab, _serverItem_Prefab.parent);
        UILoginPanel_ServerItem serverItem = tmpServerItem.GetComponent <UILoginPanel_ServerItem>();

        serverItem.Init(serverItemData, SelectServerItem);
        tmpServerItem.gameObject.SetActive(true);
        tmpServerItem.name = serverItemData.ToString();
        serverItemList.Add(serverItem);
    }
Example #2
0
 private void SelectServerItem(UILoginPanel_ServerItem.sItemData serverItemData)
 {
     curSelectServerItemData = serverItemData;
     for (int i = 0; i < serverItemList.Count; i++)
     {
         serverItemList [i].Update_ServerName(serverItemList [i].ItemData.Ip.Equals(serverItemData.Ip));
     }
     PlayerPrefs.SetString(playerprefasKey, curSelectServerItemData.ToString());
     _txtCurServerName.text = curSelectServerItemData.Name;
     HidePanel_ServerList();
 }