yyl
6 小时以前 5d3366f2e0f687995eb7ad2107c4379fe7acd4e8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
//public class ChatFriendCell : ScrollerUI
//{
//    [SerializeField] RichText m_ChatText;
//    [SerializeField] Text m_VipText;
//    [SerializeField] Text m_NameText;
//    [SerializeField] AvatarCell m_ChatIcon;
//    [SerializeField] ImageFitterText m_ImageFitter;
 
//    public override void Refresh(CellView cell)
//    {
//        var _index = cell.index;
//        int _playerId = ChatCtrl.Inst.PteChatID;
//        var _list = ChatCtrl.Inst.GetChatInfo(_playerId);
//        if (_list != null && _index < _list.Count)
//        {
//            ChatFriendData chat = _list[_index];
//            m_ChatText.text = chat.content;
//            if (type == ScrollerDataType.Header)
//            {
//                m_ChatText.AutoNewLine = false;
//                if (m_ChatText.preferredWidth > m_ChatText.rectTransform.rect.width)
//                {
//                    m_ChatText.alignment = TextAnchor.UpperLeft;
//                }
//                else
//                {
//                    m_ChatText.alignment = TextAnchor.UpperRight;
//                }
//                m_ChatText.AutoNewLine = true;
//            }
//            m_ImageFitter.FiterRealTxtWidth = m_ChatText.alignment == TextAnchor.UpperRight;
//            m_VipText.text = chat.vipLv > 0 ? StringUtility.Contact("V", chat.vipLv) : string.Empty;
//            m_NameText.text = chat.name;
//            m_ChatIcon.InitUI(AvatarHelper.GetAvatarModel(chat.player, chat.face, chat.facePic, chat.job));
//            m_ChatText.text = chat.content;
//        }
//    }
//}