using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using ZXK.Framework; /******************************************************************************* *Create By CG *Function 事件中心管理_订阅者 *******************************************************************************/ namespace SubScriberCtrl { public class SubScriberCtrl : MonoBehaviour { // Start is called before the first frame update void Start() { EventCenterManager.Instance.AddEventListener(EventEnum.Test, TalkCall); } private void OnDestroy() { EventCenterManager.Instance.RemoveListener(EventEnum.Test, TalkCall); } public void TalkCall(object sender,EventArgs e) { MyEventArgs data = e as MyEventArgs; Debug.Log($"订阅者接收到{data._Name}的消息"); } } }