public void NotifySubject(GameEventType eventType) { IGameEventSubject sub = GetGameEvent(eventType); if (sub != null) { sub.Notify(); } }
/// <summary> /// 触发 /// </summary> /// <param name="gameEventType"></param> public void NotifySubject(GameEventType gameEventType) { IGameEventSubject sub = GetGameEventSubject(gameEventType); if (sub == null) { return; } sub.Notify(); }
/// <summary> /// 广播 /// </summary> /// <param name="eventType"></param> /// <param name="args"></param> public void NotifySubject(GameEventType eventType, params int[] args) { IGameEventSubject subject = GetGameEventSubject(eventType); if (subject == null) { return; } subject.Notify(args); }
/// <summary> /// 发布消息,带参数 /// </summary> /// <param name="eventType">消息类型</param> /// <param name="paremter">需要传递的参数(Object方便转换,比如Struct或者Class)</param> public void NotyfySubject(GameEventType eventType, System.Object paremter) { IGameEventSubject sub = GetGameEventSub(eventType); if (sub == null) { return; } sub.Notify(paremter); }