コード例 #1
0
    public void NotifySubject(GameEventType eventType)
    {
        IGameEventSubject sub = GetGameEvent(eventType);

        if (sub != null)
        {
            sub.Notify();
        }
    }
コード例 #2
0
    /// <summary>
    /// 触发
    /// </summary>
    /// <param name="gameEventType"></param>
    public void NotifySubject(GameEventType gameEventType)
    {
        IGameEventSubject sub = GetGameEventSubject(gameEventType);

        if (sub == null)
        {
            return;
        }
        sub.Notify();
    }
コード例 #3
0
    /// <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);
    }
コード例 #4
0
    /// <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);
    }