public void ResetData()
    {
        curIndex = 0;
        CurTask  = null;
        CurState = TALKSTATE.BEFORE;

        mAniPlayCurTime = 0;
        mAniPlayIng     = false;
        mHeadEffected   = false;
        mMustPlayEffect = false;

//		NGUITools.SetActive(FinishedTipSprite.gameObject,false);

        Globals.Instance.MSceneManager.mTaskCamera.enabled       = true;
        Globals.Instance.MSceneManager.mTaskCamera.targetTexture = null;
        Globals.Instance.MSceneManager.mMainCamera.enabled       = false;

        GUITaskTrack tasktrack = Globals.Instance.MGUIManager.GetGUIWindow <GUITaskTrack>();

        if (tasktrack != null)
        {
            tasktrack.SetVisible(false);
        }


        GUIBuildExplore guiBuildExplore = Globals.Instance.MGUIManager.GetGUIWindow <GUIBuildExplore>();

        if (guiBuildExplore != null)
        {
            guiBuildExplore.SetVisible(false);
        }

        GUIMain guiMain = Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>();

        if (guiMain != null)
        {
            guiMain.SetVisible(false);
        }

        NGUITools.SetActive(TaskLabelGameObject, false);

//		NGUITools.SetActive(spriteTalkBackground.gameObject,true);

//		NGUITools.SetActive(mMaskLayer.gameObject,true);
        NGUITools.SetActive(mSpeaker.gameObject, true);
    }
    public void SetGameState(GameState state)
    {
        // Release last GameState logic
        if (_mGameState == GameState.GAME_STATE_COPY &&
            state == GameState.GAME_STATE_BATTLE)
        {
            // Do not Release
        }
        else
        {
            if (_mCurrentGameStatus != null)
            {
                _mCurrentGameStatus.Release();
            }
        }

        GameState lastState = _mGameState;

        _mGameState = state;

        _mLastGameStatus = _mCurrentGameStatus;
        _mGameNextState  = GameState.GAME_STATE_INVALID;
        switch (_mGameState)
        {
        case GameState.GAME_STATE_INITIAL:
        {
            _mGameStatusPublisher.NotifyGameStateInitial();
            break;
        }

        case GameState.GAME_STATE_LOADING:
        {
            _mGameStatusPublisher.NotifyGameStateLoading();
            break;
        }

        case GameState.GAME_STATE_ROLE_CREATE:
        {
            //_mGameStatusPublisher.NotifyGameStateRoleCreate();

            //long roleID = Globals.Instance.MGameDataManager.MActorData.PlayerID;
            //string testRoleName = "yingpan";
            //string roleName =  testRoleName + roleID.ToString();
            //int gender = 1;

            //string avatarName = "AvatarMan1";
            //int templateId = 1217001000;
            //int countryID = -1;
            //NetSender.Instance.RequestCreatePlayer(roleName, gender, countryID, avatarName, templateId);

            //break;
            GUIGuoChang.Show();
            Globals.Instance.MGUIManager.CreateWindow <GUICreateRole>
            (
                delegate(GUICreateRole gui)
                {
                    GUIGuoChang.SetTweenPlay(0, delegate {
                        gui.UpdateZeroStep();
                    });
                }
            );

            break;
        }

        case GameState.GAME_STATE_LOGIN:
        {
            _mGameStatusPublisher.NotifyGameStateLogin();
            break;
        }

        case GameState.GAME_STATE_PORT:
        {
            _mGameStatusPublisher.NotifyGameStatePort();
            //Globals.Instance.MTeachManager.NewQianZhiFinshed();

            _mCurrentGameStatus = _pPortStatus;

            if (Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>() == null)
            {
                Globals.Instance.MGUIManager.CreateWindow <GUIMain>(delegate(GUIMain gui)
                    {
                        NetSender.Instance.GetLotteryInfoReq();
                        Globals.Instance.MGameDataManager.MActorData.NotifyWorthUpdate();
                        Globals.Instance.MGameDataManager.MActorData.NotifyPlayerInfoUpdate();
                        gui.SetUISceneStatus(GUIMain.ESceneType.PORT);
                        if (!Globals.Instance.MTeachManager.IsOpenTeach)
                        {
                            gui.FunctionButtonState();
                        }
                        TaskManager.ReadGameFinishDataFilename();

                        NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.Recharge);
                        NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.GameInner);
                        NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.PromotionGift);

//					if (GameDefines.OutputVerDefs == OutputVersionDefs.Windows)
//					{
////						NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.Recharge);
////						NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.GameInner);
////						NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.PromotionGift);
//					}
//					else    if (GameDefines.OutputVerDefs == OutputVersionDefs.AppStore)
//					{
//						#if UNITY_IPHONE
//						PlayerData actorData = Globals.Instance.MGameDataManager.MActorData;
//						string str = "101119" + Globals.Instance.MGameDataManager.MActorData.PlayerID.ToString();
//						string str2 = actorData.BasicData.Name;
//						U3dAppStoreSender.LoginKTPlay(str,str2);
//						Debug.Log("IPHONE KTPlayLogin:"******"IPHONE CYLogin:"******"RequestVipStoreRechargeInfo");
////						NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.Recharge);
////						NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.GameInner);
////						NetSender.Instance.RequestVipStoreRechargeInfo((int)CommodityType.PromotionGift);
//						#endif
//					}
//					else if(GameDefines.OutputVerDefs==OutputVersionDefs.WPay)
//					{
//						PlayerData actorData = Globals.Instance.MGameDataManager.MActorData;
//						string str = "103214" + Globals.Instance.MGameDataManager.MActorData.PlayerID.ToString();
//						string str2 = actorData.BasicData.Name;
//						AndroidSDKAgent.LoginKTPlay(str,str2);
//						Debug.Log("ANDROID KTPlayLogin:"******"x03") == 0)
            {
                Globals.Instance.MTeachManager.NewOpenTeach("x03", 1);
            }
            break;
        }

        case GameState.GAME_STATE_HOME:
        {
            _mCurrentGameStatus = _homeStatus;
            _mCurrentGameStatus.Initialize();

            GUIBuildExplore guiBuildExplore = Globals.Instance.MGUIManager.GetGUIWindow <GUIBuildExplore>();
            if (guiBuildExplore != null)
            {
                guiBuildExplore.Close();
            }

            Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>().SetVisible(false);
            break;
        }

        case GameState.GAME_STATE_COPY:
        {
            _mGameStatusPublisher.NotifyGameStateCopy();
            _mCurrentGameStatus = _pCopyStatus;

            // Battle and Copy is mutex in some time
            if (lastState == GameState.GAME_STATE_BATTLE)
            {
                // When switch from BattleStatus, we need do something in CopyStatus
                _pCopyStatus.OnBattleEnd(_pBattleStatus.MBattleResult);
            }
            else
            {
                _mCurrentGameStatus.Initialize();
            }

            Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>().SetVisible(true);
            Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>().SetUISceneStatus(GUIMain.ESceneType.COPY);

            /*GUIPublicWarn gui = Globals.Instance.MGUIManager.GetGUIWindow<GUIPublicWarn>();
             * if (null != gui)
             *      gui.SetVisible(true);
             */
            GUITaskTrack GUITaskTrack = Globals.Instance.MGUIManager.GetGUIWindow <GUITaskTrack>();
            if (null != GUITaskTrack)
            {
                GUITaskTrack.SetVisible(true);
                GUITaskTrack.UpdateData();
            }

            break;
        }

        case GameState.GAME_STATE_BATTLE:
        {
            EnterPKBattleByPlayerDock = (lastState == GameState.GAME_STATE_PLAYER_DOCK);

            _mGameStatusPublisher.NotifyGameStateBattle();
            _mCurrentGameStatus = _pBattleStatus;

            Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>().SetVisible(false);
            //Globals.Instance.MGUIManager.GetGUIWindow<GUIPublicWarn>().SetVisible(false);

            GUITaskTrack GUITaskTrack = Globals.Instance.MGUIManager.GetGUIWindow <GUITaskTrack>();
            if (null != GUITaskTrack)
            {
                GUITaskTrack.SetVisible(false);
            }

            _mCurrentGameStatus.Initialize();

            break;
        }

        case GameState.GAME_STATE_PLAYER_DOCK:
        {
            _mCurrentGameStatus.Release();
            _mCurrentGameStatus = _pPlayerDockStatus;
            _mCurrentGameStatus.Initialize();

            Globals.Instance.MGUIManager.GetGUIWindow <GUIMain>().SetUISceneStatus(GUIMain.ESceneType.DOCK);

            break;
        }
        }
    }