using System.Collections; using System.Collections.Generic; using UnityEngine; using AX.MessageSystem; public class PlanUIActiveCtrl : MonoBehaviour { // Use this for initialization void Start () { //UIActive(); MessageDispatcher.AddListener("UI_ACTIVE", UIActive); } /// /// 控制UI显隐 /// private void UIActive(IMessage obj) { if (ModeHelper.Mode == Mode.None) { gameObject.SetActive(true); } if (ModeHelper.Mode == Mode.MobileCommunication) { gameObject.SetActive(false); } } private void OnDestroy() { MessageDispatcher.RemoveListener("UI_ACTIVE", UIActive); } // Update is called once per frame void Update () { } }