public void DeleteFriend(uint userID) { for (byte i = 0; i < m_FriendList.Count;) { if (m_FriendList[i].FriendItemInfo.GetUserID() == userID) { FriendItemUI item = m_FriendList[i]; m_Grid[0].RemoveChild(item.m_BaseTrans); item.ShutDown(); Utility.ListRemoveAt(m_FriendList, i); //删除完好友后将本地保聊天信息清除 RuntimeInfo.DeleteLocalChatFile(RuntimeInfo.GetChatLogFileName(PlayerRole.Instance.RoleInfo.RoleMe.GetUserID(), userID)); break; } else { i++; } } m_ScrollTrans[0].localPosition = new Vector3(151, 46.8f, 0); m_UIPanel[0].clipOffset = new Vector2(0, -142); m_FriendsCout.text = string.Format("当前好友数:{0}", m_FriendList.Count); }