Ejemplo n.º 1
0
    public void PKReciveSetAppFriends(string msg)
    {
        _PKAppFriends = JsonConvert.DeserializeObject <PK.AppFriends.RECEIVE>(msg);
        for (int i = 0; i < _PKAppFriends.data.Length; i++)
        {
            _PKAppFriends.data[i].me = false;
            _AppFriendsList.Add(_PKAppFriends.data[i]);
        }

        // Add my information
        PK.AppFriends.REData myInfo = new PK.AppFriends.REData();
        myInfo.balance    = _PKUserInfo.GetBalance();
        myInfo.giftable   = false;
        myInfo.first_name = _PKUserInfo.GetFirstName();
        myInfo.last_name  = _PKUserInfo.GetLastName();
        myInfo.picture    = _PKUserInfo.GetUserPhotoURL();
        myInfo.id         = _PKUserInfo.data.id.ToString();
        myInfo.uid        = _PKUserInfo.data.uid.ToString();
        myInfo.me         = true;
        _AppFriendsList.Add(myInfo);

        _AppFriendsList.Sort((x, y) => y.balance.CompareTo(x.balance));
        for (int i = 0; i < _AppFriendsList.Count; i++)
        {
            _AppFriendsList[i].ranking = i + 1;
        }
    }
Ejemplo n.º 2
0
    public void SetData(PK.AppFriends.REData info)
    {
        isAppFriend  = true;
        _FriendsInfo = info;
        _id          = System.Convert.ToInt64(info.uid);
        _url         = info.picture;
        //_textBalance.text = info.balance.ToString("#,#0");
        _textName.text = info.GetName();

        /*
         * if (info.id == USER.I.GetUserInfo().GetIdString())
         * {
         *  _toggleCheck.GetComponent<Toggle>().interactable = false;
         * }*/
    }
Ejemplo n.º 3
0
    public void SetInfo(PK.AppFriends.REData info)
    {
        _Info             = info;
        _textName.text    = info.GetName();
        _textBalance.text = info.balance.ToString("#,#0");
        if (info.ranking > 3)
        {
            _imgRank.gameObject.SetActive(false);
        }
        else
        {
            _imgRank.sprite = DB.Icon.GetFrinedsRankSprite(info.ranking);
        }

        if (info.id == USER.I.GetUserInfo().GetIdString())
        {
            _btnSendGift.GetComponent <Button>().interactable = false;
        }

        USER.I.AddFacebookPicture(info.picture, (x) =>
        {
            _imgPhoto.texture = x;
        });
    }