贵港吾悦商业管理有限公司多角色网上演练(吾悦广场)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

96 lines
3.1 KiB

//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<ChatMessage> GetSendMsg()
{
List<ChatMessage> sendchatlist = new List<ChatMessage>();
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<ChatMessage> GetReceiveMsg()
{
List<ChatMessage> receivechatlist = new List<ChatMessage>();
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<long> GetChildOriIdList()
{
List<long> idlist = new List<long>();
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;
}
}