コード例 #1
0
 public void RefreshChats(List <ChatManager.ChatInfo> chatInfos)
 {
     this.ClearChats();
     if (chatInfos.get_Count() == 0)
     {
         return;
     }
     for (int i = 0; i < chatInfos.get_Count(); i++)
     {
         ChatInfoBase chatInfoBase = ChatManager.CreatePrefab2TipChatInfo(string.Empty);
         chatInfoBase.ShowInfo(chatInfos.get_Item(i));
         this.Chats.Add(chatInfoBase);
     }
     while (this.Chats.get_Count() > 0 && this.CalHeight4Chats(this.Chats.get_Count()) > 88f)
     {
         ChatManager.Reuse2TipChatInfoPool(this.Chats.get_Item(0));
         this.Chats.RemoveAt(0);
     }
     for (int j = 0; j < this.Chats.get_Count(); j++)
     {
         RectTransform rectTransform = this.Chats.get_Item(j).get_transform() as RectTransform;
         UGUITools.ResetTransform(rectTransform.get_transform(), this.m_tranContent);
         rectTransform.set_anchoredPosition(new Vector2(0f, -this.CalHeight4Chats(j)));
     }
 }