コード例 #1
0
    public override void read(ErlKVMessage message)
    {
        ErlType str = message.getValue("msg") as ErlType;

        if (str is ErlArray)
        {
            ErlArray arr = str as ErlArray;
            List <GodsWarRankUserInfo> list = new List <GodsWarRankUserInfo>();
            if (arr.Value.Length != 0)
            {
                for (int i = 0; i < arr.Value.Length; i++)
                {
                    ErlArray            tmp  = arr.Value[i] as ErlArray;
                    GodsWarRankUserInfo user = new GodsWarRankUserInfo();
                    user.bytesRead(tmp);
                    list.Add(user);
                }
            }
            if (list.Count > 0)
            {
                GodsWarManagerment.Instance.myGroupRanklist = list;
            }
        }

        if (callback != null)
        {
            callback();
            MaskWindow.UnlockUI();
        }
    }
コード例 #2
0
    void setText(GodsWarRankUserInfo data, int index)
    {
        int pos = 0;

        texts[pos++].text = (index + 1).ToString();
        texts[pos++].text = "[" + data.serverName + "]" + data.name;
        texts[pos++].text = data.num.ToString();
    }
コード例 #3
0
    public override void read(ErlKVMessage message)
    {
        ErlType str = message.getValue("msg") as ErlType;

        if (str is ErlArray)
        {
            ErlArray arr = str as ErlArray;
            List <GodsWarRankUserInfo> list = new List <GodsWarRankUserInfo>();
            if (arr.Value.Length != 0)
            {
                for (int i = 0; i < arr.Value.Length; i++)
                {
                    ErlArray            tmp  = arr.Value[i] as ErlArray;
                    GodsWarRankUserInfo user = new GodsWarRankUserInfo();
                    user.bytesRead(tmp);
                    list.Add(user);
                }
            }
            if (list.Count > 0)
            {
                switch (big_id)
                {
                case 110:
                    GodsWarManagerment.Instance.usersRankList_bronze = list;
                    break;

                case 111:
                    GodsWarManagerment.Instance.usersRankList_silver = list;
                    break;

                case 112:
                    GodsWarManagerment.Instance.usersRankList_gold = list;
                    break;

                default:
                    break;
                }
            }
        }

        if (callback != null)
        {
            callback();
            MaskWindow.UnlockUI();
        }
    }
コード例 #4
0
    public void init(GodsWarRankUserInfo data, int index)
    {
        this.data  = data;
        this.index = index;

        setText(data, index);

        //给前三名加金杯,银杯,铜杯
        if (cup != null)
        {
            switch (index)
            {
            case 0:
                cup.spriteName = "rank_1";
                cup.gameObject.SetActive(true);
                texts[0].transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
                texts[0].text = "";
                break;

            case 1:
                cup.spriteName = "rank_2";
                cup.gameObject.SetActive(true);
                texts[0].transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
                texts[0].text = "";
                break;

            case 2:
                cup.spriteName = "rank_3";
                cup.gameObject.SetActive(true);
                texts[0].transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
                texts[0].text = "";
                break;

            default:
                cup.spriteName = null;
                cup.gameObject.SetActive(false);
                texts[0].transform.localScale = new Vector3(1f, 1f, 1f);
                break;
            }
        }
        setSpriteBg();
    }