public void OnEvent(FEvent evt) { switch ((GameEventEnum)evt.GetEventId()) { case GameEventEnum.GameEvent_Loading: { GameStateTypeEnum stateType = (GameStateTypeEnum)evt.GetParam("NextState"); LoadingState lState = GameStateManager.Instance.getState(GameStateTypeEnum.GS_Loading) as LoadingState; lState.SetNextState(stateType); lState.SetFrontScenes(View.EScenesType.EST_Play); SetStateTo(GameStateTypeEnum.GS_Loading); } break; case GameEventEnum.GameEvent_IntoRoom: { LoadingState lState = GameStateManager.Instance.getState(GameStateTypeEnum.GS_Loading) as LoadingState; lState.SetNextState(GameStateTypeEnum.GS_Room); lState.SetFrontScenes(View.EScenesType.EST_Play); SetStateTo(GameStateTypeEnum.GS_Loading); } break; case GameEventEnum.GameEvent_IntoLobby: { LoadingState lState = GameStateManager.Instance.getState(GameStateTypeEnum.GS_Loading) as LoadingState; lState.SetNextState(GameStateTypeEnum.GS_Lobby); lState.SetFrontScenes(View.EScenesType.EST_Play); SetStateTo(GameStateTypeEnum.GS_Loading); } break; } }
private void SdkLogOff() { GameMethod.LogOutToLogin(); LoadingState lState = GameStateManager.Instance.getState(GameStateTypeEnum.GS_Loading) as LoadingState; lState.SetNextState(GameStateTypeEnum.GS_Login); lState.SetFrontScenes(View.EScenesType.EST_Play); SetStateTo(GameStateTypeEnum.GS_Loading); }
public void OnEvent(FEvent evt) { switch ((GameEventEnum)evt.GetEventId()) { case GameEventEnum.GameEvent_IntoRoom: { //获取当前状态 LoadingState lState = GameStateManager.Instance.getState(GameStateTypeEnum.GS_Loading) as LoadingState; lState.SetNextState(GameStateTypeEnum.GS_Room); lState.SetFrontScenes(View.EScenesType.EST_Play); SetStateTo(GameStateTypeEnum.GS_Loading); } break; } }
public void OnEvent(FEvent evt) { switch ((GameEventEnum)evt.GetEventId()) { case GameEventEnum.GameEvent_IntoRoom: //创建房间(自定义) SetStateTo(GameStateTypeEnum.GS_Room); break; case GameEventEnum.GameEvent_IntoHero: //英雄选择 GameStateManager.Instance.ChangeGameStateTo(GameStateTypeEnum.GS_Hero); break; case GameEventEnum.GameEvent_Loading: //加载状态 GameStateTypeEnum stateType = (GameStateTypeEnum)evt.GetParam("NextState"); LoadingState lState = GameStateManager.Instance.getState(GameStateTypeEnum.GS_Loading) as LoadingState; lState.SetNextState(stateType); lState.SetFrontScenes(View.EScenesType.EST_Login); SetStateTo(GameStateTypeEnum.GS_Loading); break; } }