Beispiel #1
0
        //如果客户端没有发起请求,但是服务器端向客户端通知一些事情的时候就会通过OnEvent来进行响应
        public void OnEvent(EventData eventData)
        {
            MessageCode code = (MessageCode)eventData.Code;//得到响应的EventCode

            EventMediat.Dispatch(code, eventData);
        }
Beispiel #2
0
 public override void RemoveListener()
 {
     EventMediat.RemoveListener(EventCode.NewPlayer, OnSyncPlayerReceived);
 }
Beispiel #3
0
 public override void RemoveListener()
 {
     EventMediat.RemoveListener(MessageCode.AddPlayer, OnSyncAddPlayerReceived);
     EventMediat.RemoveListener(MessageCode.RemovePlayer, OnSyncRemovePlayerReceived);
     EventMediat.RemoveListener(MessageCode.PlayerDead, OnSyncPlayerDeadReceived);
 }
Beispiel #4
0
 public override void RemoveListener()
 {
     EventMediat.RemoveListener(MessageCode.SyncTransition, OnSyncTransitionReceived);
 }
 public override void AddListener()
 {
     EventMediat.AddListener(EventCode.SyncPosition, OnSyncPositionReceived);
 }
Beispiel #6
0
 public override void AddListener()
 {
     EventMediat.AddListener(MessageCode.SyncTransform, OnSyncTransformReceived);
 }
Beispiel #7
0
 public override void AddListener()
 {
     EventMediat.AddListener(MessageCode.AddBomb, OnAddBombReceived);
     EventMediat.AddListener(MessageCode.OpenBomb, OnOpenBombReceived);
 }