예제 #1
0
 public void Init(FriendInfo info, int rank)
 {
     curInfo = info;
     if (rank <= 3)
     {
         if (rank == 0)
         {
             rankLb.gameObject.SetActive(false);
             rankIcon.gameObject.SetActive(false);
         }
         else
         {
             rankLb.gameObject.SetActive(false);
             rankIcon.gameObject.SetActive(true);
             rankIcon.sprite = BundleManager.Instance.GetSprite("common/normal_jiangbei_" + rank);
         }
     }
     else
     {
         rankLb.gameObject.SetActive(true);
         rankIcon.gameObject.SetActive(false);
         rankLb.text = rank.ToString();
     }
     if (gameObject.activeInHierarchy)
     {
         StartCoroutine(MiscUtils.DownloadImage(info.photo, spr =>
         {
             headIcon.sprite = spr;
         }));
     }
     nameLb.text    = info.nickname;
     sixIcon.sprite = BundleManager.Instance.GetSprite("friend/" + (info.gender == 0 ? "haoyou_pic_nan" : "haoyou_pic_nv"));
     yinbiLb.text   = info.sliver.ToString();
     if (info.isOnline == 0)
     {
         stateLb.text  = "[离线]";
         stateLb.color = Color.red;
     }
     else
     {
         stateLb.text  = "[在线]";
         stateLb.color = Color.green;
     }
     UGUIEventListener.Get(giveBtn).onClick = delegate
     {
         SocialNode.GiveCall(info);
     };
     UGUIEventListener.Get(chatBtn).onClick = delegate
     {
         SocialNode.ChatCall(info);
     };
     UGUIEventListener.Get(headBtn).onClick = delegate
     {
         SocialNode.HeadCall(info, true);
     };
 }
예제 #2
0
    /// <summary>
    /// 会话按钮回调
    /// </summary>
    void Chat()
    {
        FriendInfo info = new FriendInfo();

        info.exp      = curInfo.exp;
        info.gender   = curInfo.six == Six.boy ? 0 : 1;
        info.level    = curInfo.lv;
        info.nickname = curInfo.userNickname;
        info.photo    = curInfo.icon;
        info.sliver   = curInfo.money;
        info.userId   = int.Parse(curInfo.uid);
        SocialNode.ChatCall(info);
        SetVisibel(false);
    }