网上演练贵港万达广场(人员密集)
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.
 
 
 

67 lines
2.2 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SenderWinManager : MonoBehaviour {
public List<UserData> zhongDuiUsersInRoom = new List<UserData>();
public GameObject senderItem;
public GameObject Content;
// Use this for initialization
void Awake () {
Content = transform.Find("Scroll View/Viewport/Content").gameObject;
if (CurrentUserInfo.room != null)
{
foreach (UserData item in CurrentUserInfo.room.UserList)
{
if (item.Org.Level == 4 /*&& item.UserInfo.Id != CurrentUserInfo.mySelf.Id*/)
{//作战部署接收者显示所有中队,不然总指挥是中队时,无法发给他自己的上下级
zhongDuiUsersInRoom.Add(item);
}
}
}
foreach (UserData item in zhongDuiUsersInRoom)
{
GameObject receive = GameObject.Instantiate(senderItem, Content.transform) as GameObject;
receive.transform.Find("Label").GetComponent<Text>().text = item.Org.DisplayName;
receive.GetComponent<SenderItemMessage>().receiverUser = item;
}
}
private void OnEnable()
{
zhongDuiUsersInRoom.Clear();
if (CurrentUserInfo.room != null)
{
foreach (UserData item in CurrentUserInfo.room.UserList)
{
if (item.Org.Level == 4 /*&& item.UserInfo.Id != CurrentUserInfo.mySelf.Id*/)
{//作战部署接收者显示所有中队,不然总指挥是中队时,无法发给他自己的上下级
zhongDuiUsersInRoom.Add(item);
}
}
}
foreach (Transform item in Content.transform)
{
Destroy(item.gameObject);
}
foreach (UserData item in zhongDuiUsersInRoom)
{
GameObject receive = GameObject.Instantiate(senderItem, Content.transform) as GameObject;
receive.transform.Find("Label").GetComponent<Text>().text = item.Org.DisplayName;
receive.GetComponent<SenderItemMessage>().receiverUser = item;
}
}
// Update is called once per frame
void Update () {
}
}