//如果客户端没有发起请求,但是服务器端向客户端通知一些事情的时候就会通过OnEvent来进行响应 public void OnEvent(EventData eventData) { MessageCode code = (MessageCode)eventData.Code;//得到响应的EventCode EventMediat.Dispatch(code, eventData); }
public override void RemoveListener() { EventMediat.RemoveListener(EventCode.NewPlayer, OnSyncPlayerReceived); }
public override void RemoveListener() { EventMediat.RemoveListener(MessageCode.AddPlayer, OnSyncAddPlayerReceived); EventMediat.RemoveListener(MessageCode.RemovePlayer, OnSyncRemovePlayerReceived); EventMediat.RemoveListener(MessageCode.PlayerDead, OnSyncPlayerDeadReceived); }
public override void RemoveListener() { EventMediat.RemoveListener(MessageCode.SyncTransition, OnSyncTransitionReceived); }
public override void AddListener() { EventMediat.AddListener(EventCode.SyncPosition, OnSyncPositionReceived); }
public override void AddListener() { EventMediat.AddListener(MessageCode.SyncTransform, OnSyncTransformReceived); }
public override void AddListener() { EventMediat.AddListener(MessageCode.AddBomb, OnAddBombReceived); EventMediat.AddListener(MessageCode.OpenBomb, OnOpenBombReceived); }