using UnityEngine; using System.Collections; using AX.MessageSystem; public class ListMessageControl : MonoBehaviour { void OnDestroy() { MessageDispatcher.RemoveListener("SHOWUI", Hide); } void OnEnable() { MessageDispatcher.AddListener("SHOWUI", Hide); gameObject.SetActive(false); } void Hide(IMessage message) { if ((string)message.Data == this.gameObject.name) { this.gameObject.SetActive(true); } } }