예제 #1
0
 public void DropCallBackLocalEvent(ChuMeng.MyEvent.EventType t, ChuMeng.EventDel cb)
 {
     ChuMeng.MyEventSystem.myEventSystem.DropLocalListener(photonView.GetLocalId(), t, cb);
     foreach (var e in regLocalEvtCallback)
     {
         if (e.t == t && e.cb == cb)
         {
             regLocalEvtCallback.Remove(e);
             break;
         }
     }
 }
예제 #2
0
        public void AddCallBackLocalEvent(ChuMeng.MyEvent.EventType t, ChuMeng.EventDel cb)
        {
            regYet = true;
            if (regLocalEvtCallback == null)
            {
                regLocalEvtCallback = new List <EvtCbPair>();
            }

            regLocalEvtCallback.Add(new EvtCbPair()
            {
                t  = t,
                cb = cb,
            });
            ChuMeng.MyEventSystem.myEventSystem.RegisterLocalEvent(photonView.GetLocalId(), t, cb);
        }
예제 #3
0
 /// <summary>
 /// 注册一个全局事件
 /// 在RegEvent之后添加事件
 /// </summary>
 /// <param name="t">T.</param>
 protected void AddEvent(ChuMeng.MyEvent.EventType t)
 {
     regEvt.Add(t);
     ChuMeng.MyEventSystem.myEventSystem.RegisterEvent(t, OnEvent);
 }