using AX.MessageSystem;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 供水报告面板
/// </summary>
public class WaterSupplyPanel : MonoBehaviour {
    public ButtonRecordByAC CloseButton;
    // Use this for initialization
    void Start () {
        MessageDispatcher.AddListener(FireInfoMessage.WaterSupplyReport.ToString(), OpenPanel);
        CloseButton = transform.Find("HeadTitleBG/CloseButton").GetComponent<ButtonRecordByAC>();
        CloseButton.OutInterFaceButton = closeClick;
        gameObject.SetActive(false);
	}
    private void OnDestroy()
    {
        MessageDispatcher.RemoveListener(FireInfoMessage.WaterSupplyReport.ToString(), OpenPanel);
    }
    void OpenPanel(IMessage obj)
    {
        var value = (bool)obj.Data;
        gameObject.SetActive(value);
    }
    private void closeClick()
    {
        MessageDispatcher.SendMessage("CloseFireInfoPanel", (int)FireInfoMessage.WaterSupplyReport);
    }
}