//using Boo.Lang; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Commandcountnum : MonoBehaviour { public Text sendtext; public Text receivetext; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Space)) { sendtext.text = "send:" + GetSendMsg().Count; receivetext.text = "receive:" + GetReceiveMsg().Count; } } private List GetSendMsg() { List sendchatlist = new List(); for (int i = 0; i < ReportDataMgr.AllChatMessage.Count; i++) { if (ReportDataMgr.AllChatMessage[i].SenderId==CurrentUserInfo.mySelf.Id) {//当前客户端发送的 // if (ChatManager.Instance.FindDirectionSubUserDataID().Contains(ReportDataMgr.AllChatMessage[i].ReceiverId)) {//直接下级为接收方 sendchatlist.Add(ReportDataMgr.AllChatMessage[i]); } } } return sendchatlist; } private List GetReceiveMsg() { List receivechatlist = new List(); for (int i = 0; i < ReportDataMgr.AllChatMessage.Count; i++) { if (!(CurrentUserInfo.role == Role.导调组 || CurrentUserInfo.role == Role.参谋)) { if (ReportDataMgr.AllChatMessage[i].ReceiverId == CurrentUserInfo.mySelf.Id) { receivechatlist.Add(ReportDataMgr.AllChatMessage[i]); //if (ChatManager.Instance.FindDirectionSubUserDataID().Contains(ReportDataMgr.AllChatMessage[i].SenderId)) //{ // receivechatlist.Add(ReportDataMgr.AllChatMessage[i]); //} //if (ChatManager.Instance.FindDirectionSupUserDataID()== ReportDataMgr.AllChatMessage[i].SenderId) //{ // receivechatlist.Add(ReportDataMgr.AllChatMessage[i]); //} } } else { receivechatlist.Add(ReportDataMgr.AllChatMessage[i]); } } return receivechatlist; } private List GetChildOriIdList() { List idlist = new List(); for (int i = 0; i < CurrentUserInfo.room.UserList.Count; i++) { if (CurrentUserInfo.room.UserList[i].Org.ParentId==CurrentUserInfo.mySelf.Id) { idlist.Add(CurrentUserInfo.room.UserList[i].UserInfo.Id); } } return idlist; } private long GetDirectionOriId() { long parentoriid = 0; for (int i = 0; i < CurrentUserInfo.room.UserList.Count; i++) { if (CurrentUserInfo.room.UserList[i].UserInfo.Id == CurrentUserInfo.mySelf.Id) { parentoriid = CurrentUserInfo.room.UserList[i].Org.ParentId; } } return parentoriid; } }