贵港路建设路地下商业街网上演练
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.
 
 
 

43 lines
1.3 KiB

using UnityEngine;
using AX.MessageSystem;
using System;
using UnityEngine.UI;
public class FireInfoListToggle : BaseToggle {
private Transform mFireSitePopup;
Toggle thistoggle;
void Start()
{
mFireSitePopup = transform.parent.transform.Find("FireSiteInfoPopup");
MessageDispatcher.AddListener("CloseFireInfoPanel",Closetoggle);
thistoggle = GetComponent<Toggle>();
}
public override void OnDestroy()
{
base.OnDestroy();
MessageDispatcher.RemoveListener("CloseFireInfoPanel", Closetoggle);
}
private void Closetoggle(IMessage obj)
{
if (!thistoggle.isOn)
{
//FireInfoToggle[] toggles = GetComponentsInChildren<FireInfoToggle>(true);
//for (int i = 0; i < toggles. Length; i++)
//{
// if (toggles[i].name==num.ToString())
// {
// toggles[i].GetComponent<Toggle>().isOn = false;
// }
//}
thistoggle.isOn = true;
MessageDispatcher.SendMessage("CloseFireInfoPanel", (int)obj.Data);
thistoggle.isOn = false;
}
}
public override void RespondFun(bool value)
{
mFireSitePopup.gameObject.SetActive(value);
}
}