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

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