示例#1
0
        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;
            }
        }
示例#2
0
        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);
        }
示例#3
0
 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;
     }
 }
示例#4
0
        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;
            }
        }