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.
36 lines
737 B
36 lines
737 B
3 years ago
|
using UnityEngine;
|
||
|
using System.Collections;
|
||
|
using AX.MessageSystem;
|
||
|
public class UIMessageControl : MonoBehaviour {
|
||
|
|
||
|
void Awake ()
|
||
|
{
|
||
|
MessageDispatcher.AddListener("CarAndPeople", CarAndPeopleExecute);
|
||
|
}
|
||
|
void OnEnable()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
void CarAndPeopleExecute(IMessage message)
|
||
|
{
|
||
|
if ((string)message.Data == this.gameObject.name)
|
||
|
{
|
||
|
this.gameObject.SetActive(true);
|
||
|
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
this.gameObject.SetActive(false);
|
||
|
}
|
||
|
}
|
||
|
void OnDestroy()
|
||
|
{
|
||
|
MessageDispatcher.RemoveListener("CarAndPeople", CarAndPeopleExecute);
|
||
|
}
|
||
|
|
||
|
void Close(IMessage message)
|
||
|
{
|
||
|
this.gameObject.SetActive(false);
|
||
|
}
|
||
|
}
|