コード例 #1
0
ファイル: OverState.cs プロジェクト: aowchina/HolyTech
        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
ファイル: LoadingState.cs プロジェクト: aowchina/HolyTech
 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
ファイル: LobbyState.cs プロジェクト: aowchina/HolyTech
        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;
            }
        }