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

50 lines
1.5 KiB

using AX.MessageSystem;
using AX.Network.Protocols;
using AX.NetworkSystem;
using AX.Serialization;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InsiderFeedbackManager : MonoBehaviour {
private static InsiderFeedbackManager instance;
public static InsiderFeedbackManager Instance
{
get
{
return instance;
}
}
public List<string> feedbacks = new List<string>();
public GameObject itemPre;
void Awake()
{
instance = this;
itemPre = Resources.Load("InsiderFeedback/InsiderInfoItem") as GameObject;
//NetworkMessageDispatcher.AddListener("GET_INSIDER_ANSWER_SYNC", addFeedback);
}
//每次打开界面都重新生成
private void OnEnable()
{
for(int i = 0; i < transform.childCount; i++)
{
Destroy(transform.GetChild(i).gameObject);
}
foreach(string info in GET_INSIDER_ANSWER_SYNC.feedback)
{
addFeedback(info);
}
}
void addFeedback(string info)
{
//var info = message.Body.Deserialize<string>();
GameObject item = Instantiate(itemPre, transform);
item.GetComponent<InsiderFeedbackItem>().Set(info);
}
/*void addFeedback(BinaryMessage message)
{
var info = message.Body.Deserialize<string>();
GameObject item = Instantiate(itemPre, transform);
item.GetComponent<InsiderFeedbackItem>().Set(info);
}*/
}