天津23维预案
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.
 
 
 
 
 
 

60 lines
1.4 KiB

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System;
using AX.MessageSystem;
using AX.TrackRecord;
public class Close : MonoBehaviour {
private GameObject StorageWin;
private GameObject BagWin;
// Use this for initialization
void Start () {
MessageDispatcher.AddListener("CloseEquipUI", CloseEquipUI);
this.GetComponent<Button>().onClick.AddListener(ClosedWin);
StorageWin = GameObject.Find("Canvas").transform.Find("StorageWin").gameObject;
BagWin = GameObject.Find("Canvas").transform.Find("BagWin").gameObject;
}
public void CloseEquipUI(IMessage message)
{
if (StorageWin.activeSelf)
{
StorageWin.SetActive(false);
}
if (BagWin.activeSelf)
{
BagWin.SetActive(false);
}
}
private void ClosedWin()
{
if (StorageWin.activeSelf)
{
StorageWin.SetActive(false);
}
if (BagWin.activeSelf)
{
BagWin.SetActive(false);
}
if (RecordManager.Instance.IsRecording)
{
TrackRecordHelpClass.RecordCloseEquipUIEvent();
}
}
// Update is called once per frame
void Update () {
}
void OnDestroy()
{
this.GetComponent<Button>().onClick.RemoveListener(ClosedWin);
MessageDispatcher.RemoveListener("CloseEquipUI", CloseEquipUI);
}
}