Example #1
0
 private void SetLoadingVisible(ELoadingStyle dlgType, bool bVisible)
 {
     //switch (dlgType)
     //{
     //    case ELoadingStyle.LoadingWait:
     //        if (bVisible)
     //        {
     //            EventDispatch.Broadcast(EventsBase.OnLoadingWaitUIShow);
     //        }
     //        else
     //        {
     //            EventDispatch.Broadcast(EventsBase.OnLoadingWaitUIHide);
     //        }
     //        break;
     //    case ELoadingStyle.LoadingNormal:
     //        if (bVisible)
     //        {
     //            EventDispatch.Broadcast(Events.DlgLoadingShow);
     //        }
     //        else
     //        {
     //            EventDispatch.Broadcast(Events.DlgLoadingHide);
     //        }
     //        break;
     //}
     if (bVisible)
     {
         EventDispatch.Broadcast(Events.DlgLoadingShow);
     }
     else
     {
         EventDispatch.Broadcast(Events.DlgLoadingHide);
     }
 }
Example #2
0
        private void SetLoadingVisible(ELoadingStyle dlgType, bool bVisible)
        {
            switch (dlgType)
            {
            case ELoadingStyle.LoaidngWait:
                EventDispatch.Broadcast(this.m_sLoadWaitUIEvent);
                break;

            case ELoadingStyle.LoadingNormal:
                EventDispatch.Broadcast(this.m_sLoadNormalUIEvent);
                break;
            }
        }
    /// <summary>
    /// 设置不同加载类型的加载界面是否显示
    /// </summary>
    /// <param name="dlgType"></param>
    /// <param name="bVisible"></param>
    private void SetLoadingVisible(ELoadingStyle dlgType, bool bVisible)
    {
        switch (dlgType)
        {
        case ELoadingStyle.LoaidngWait:
            break;

        case ELoadingStyle.LoadingNormal:
            break;

        default:
            break;
        }
    }
Example #4
0
 /// <summary>
 /// 改变游戏状态,进行改变的处理
 /// </summary>
 /// <param name="eGameState"></param>
 /// <param name="loadingStyle"></param>
 /// <param name="callBackWhenChangeFinished"></param>
 public void ChangeGameState(EnumGameState eGameState, ELoadingStyle loadingStyle, Action callBackWhenChangeFinished)
 {
     if (this.IsChangingState)
     {
         StateChangeArgs item = new StateChangeArgs
         {
             GameState    = eGameState,
             LoadingStyle = loadingStyle,
             CallBack     = callBackWhenChangeFinished
         };
         this.m_GameStateQueue.Enqueue(item);
     }
     else
     {
         this.m_ClientStateMachine.ConvertToState(eGameState, loadingStyle, callBackWhenChangeFinished);
         this.RegisterCallBackOnChangedFinished(new Action(this.ChangeGameStateQueue));
     }
 }
Example #5
0
 /// <summary>
 /// 改变游戏状态
 /// </summary>
 /// <param name="eGameState"></param>
 /// <param name="loadingStyle"></param>
 /// <param name="callBackWhenChangeFinished"></param>
 public void ChangeGameState(string eGameState, ELoadingStyle loadingStyle, Action callBackWhenChangeFinished)
 {
     if (this.IsInChangingState)
     {
         ClientStateChangeArgs item = new ClientStateChangeArgs
         {
             sClientState  = eGameState,
             eLoadingStyle = loadingStyle,
             aCallBack     = callBackWhenChangeFinished
         };
         this.m_qClientStateQueue.Enqueue(item);
     }
     else
     {
         this.m_oClientStateMachine.ConvertToState(eGameState, loadingStyle, callBackWhenChangeFinished);
         this.RegisterCallBackOnChangedFinished(new Action(this.ChangeGameStateQueue));
     }
 }
Example #6
0
 public void ConvertToState(string nextGameState, ELoadingStyle loadingStyle, Action callBackOnChangeFinished, string specialStateLoad = "BattleMainState")
 {
     try
     {
         if (!nextGameState.Equals(this.CurrentGameState))
         {
             this.NextGameState                  = nextGameState;
             this.m_eCurrentLoadingStyle         = loadingStyle;
             this.m_aCallBackWhenChangeFinished += callBackOnChangeFinished;
             if ("Max" != this.CurrentGameState)
             {
                 if (ELoadingStyle.DefaultRule == this.m_eCurrentLoadingStyle)
                 {
                     if (specialStateLoad == this.CurrentGameState)
                     {
                         this.m_eCurrentLoadingStyle = ELoadingStyle.LoadingNormal;
                     }
                     else
                     {
                         this.m_eCurrentLoadingStyle = ELoadingStyle.LoadingWait;
                     }
                 }
                 this.SetLoadingVisible(this.m_eCurrentLoadingStyle, true);
             }
             this.IsInChanging = true;
             if ("Max" != this.CurrentGameState)
             {
                 this.m_oCurrentClientState.OnLeave();
                 WWWResourceManager.Instance.SetAllUnLoadFinishedEventHandler(delegate(bool o)
                 {
                     this.DoChangeToNewState();
                 });
             }
             else
             {
                 this.DoChangeToNewState();
             }
         }
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
 }
 public void ConvertToState(EnumGameState nextGameState, ELoadingStyle loadingStyle, Action callback)
 {
     if (nextGameState != this.CurrentGameState)
     {
         this.NextGameState                = nextGameState;
         this.m_currentLoadingStyle        = loadingStyle;
         this.m_callBackWhenChangeFinished = (Action)Delegate.Combine(this.m_callBackWhenChangeFinished, callback);
         if (ELoadingStyle.DefaultRule == this.m_currentLoadingStyle)
         {
             if (EnumGameState.eState_GameMain == this.CurrentGameState)
             {
                 this.m_currentLoadingStyle = ELoadingStyle.LoadingNormal;
             }
             else
             {
                 this.m_currentLoadingStyle = ELoadingStyle.LoaidngWait;
             }
         }
         //加载界面显示
         this.SetLoadingVisible(this.m_currentLoadingStyle, true);
     }
     this.IsChangingState = true;
     if (this.CurrentGameState != EnumGameState.eState_Max)
     {
         //如果不是中间状态的话,就离开该状态
         this.m_currentClientState.OnLeave();
         //设置资源全部卸载完成之后回调
         ResourceManager.singleton.SetAllUnLoadFinishedEventHandler(delegate(bool o)
         {
             this.DoChangeToNewState();
         });
     }
     else
     {
         this.DoChangeToNewState();
     }
 }
Example #8
0
 public void ConvertToState(string nextGameState, ELoadingStyle loadingStyle, Action callBackOnChangeFinished, string specialStateLoad = "")
 {
     if (!nextGameState.Equals(this.CurrentGameState))
     {
         this.NextGameState                 = nextGameState;
         this.m_eCurrentLoadingStyle        = loadingStyle;
         this.m_aCallBackWhenChangeFinished = (Action)Delegate.Combine(this.m_aCallBackWhenChangeFinished, callBackOnChangeFinished);
         if ("Max" != this.CurrentGameState)
         {
             if (ELoadingStyle.DefaultRule == this.m_eCurrentLoadingStyle)
             {
                 if (specialStateLoad == this.CurrentGameState)
                 {
                     this.m_eCurrentLoadingStyle = ELoadingStyle.LoadingNormal;
                 }
                 else
                 {
                     this.m_eCurrentLoadingStyle = ELoadingStyle.LoaidngWait;
                 }
             }
             this.SetLoadingVisible(this.m_eCurrentLoadingStyle, true);
         }
         this.IsInChanging = true;
         if ("Max" != this.CurrentGameState)
         {
             this.m_oCurrentClientState.OnLeave();
             ResourceManager.singleton.SetAllUnLoadFinishedEventHandler(delegate(bool o)
             {
                 this.DoChangeToNewState();
             });
         }
         else
         {
             this.DoChangeToNewState();
         }
     }
 }
Example #9
0
 public void ChangeGameState(EnumGameState eGameState, ELoadingStyle loadingStyle)
 {
     this.ChangeGameState(eGameState, loadingStyle, null);
 }