using AX.MessageSystem; using System.Collections; using System.Collections.Generic; using UnityEngine; /// /// 疏散救生面板 /// public class RescueInfoPanel : MonoBehaviour { public ButtonRecordByAC CloseButton; // Use this for initialization void Awake () { MessageDispatcher.AddListener(FireInfoMessage.EvacuationAndRescue.ToString(), OpenPanel); CloseButton = transform.Find("HeadTitleBG/CloseButton").GetComponent(); CloseButton.OutInterFaceButton = closeClick; gameObject.SetActive(false); } private void OnDestroy() { MessageDispatcher.RemoveListener(FireInfoMessage.EvacuationAndRescue.ToString(), OpenPanel); } private void closeClick() { MessageDispatcher.SendMessage("CloseFireInfoPanel", (int)FireInfoMessage.EvacuationAndRescue); } void OpenPanel(IMessage obj) { var value = (bool)obj.Data; gameObject.SetActive(value); } }