示例#1
0
        private void UpdateChildrenCallback(int index, Transform trans)
        {
            int count = _getServerCount();

            if (index >= count)
            {
                trans.gameObject.SetActive(false);
                return;
            }
            cdnServerInfo serverInfo = _getServerInfo(index);

            if (serverInfo == null)
            {
                return;
            }

            Button button = trans.GetComponent <Button>();

            button.onClick.RemoveAllListeners();
            button.onClick.AddListener(() => { OnServerBtnClick(serverInfo.serverId, trans); });

            Text txtServerName = trans.Find("ServerName").GetComponent <Text>();

            txtServerName.text = "S" + serverInfo.serverId + "." + serverInfo.serverName;
            //Image itemIcon = trans.Find("ItemIcon").GetComponent<Image>();
            //itemIcon.overrideSprite = Resources.Load(itemData.m_ItemCfg.m_Icon, typeof(Sprite)) as Sprite;
        }
示例#2
0
        private void _showSuggestServer()
        {
            cdnServerInfo info = LoginModel.Instance.GetShowServer();

            if (info == null)
            {
                return;
            }
            m_txtSuggestServer.text = "S" + info.serverId + "." + info.serverName;
            m_btnSuggestServer.gameObject.SetActive(true);
        }
示例#3
0
        private uint _getNewestServerId()
        {
            uint maxId = 0;

            for (int i = 0; i < _cdnInfo.serverList.Count; ++i)
            {
                cdnServerInfo serverInfo = _cdnInfo.serverList[i];
                _serverMap[serverInfo.serverId] = serverInfo;
                if (serverInfo.serverId > maxId)
                {
                    maxId = serverInfo.serverId;
                }
            }

            return(maxId);
        }
示例#4
0
        private int _getServerCount()
        {
            if (m_serverTabType == EServerTabType.AllServer)
            {
                return(NoticeModel.Instance.GetServerCount());
            }
            else if (m_serverTabType == EServerTabType.SuggetServer)
            {
                cdnServerInfo info = NoticeModel.Instance.GetNewServer();
                if (info == null)
                {
                    return(0);
                }
                return(1);
            }
            else if (m_serverTabType == EServerTabType.BelongServer)
            {
                //
                return(LoginModel.Instance.GetUserCount());
            }

            return(0);
        }