Beispiel #1
0
        //加载场景
        private IEnumerator LoadScene()
        {
            int            loadSceneProgress = 0;
            AsyncOperation op = SceneManager.LoadSceneAsync(this.sceneName);

            op.allowSceneActivation = false;
            while (op.progress < 0.9f)
            {
                loadSceneProgress = (int)(op.progress * 100);
                Debug.LogFormat("<><MainSceneLoader.LoadScene>loading......[{0}]", op.progress.ToString());
                while (displayProgress < loadSceneProgress)
                {
                    ++displayProgress;
                    imageProgress.fillAmount = displayProgress / (float)100;
                    yield return(new WaitForEndOfFrame());
                }
            }

            loadSceneProgress = 100;
            while (this.displayProgress < loadSceneProgress)
            {
                GuLog.Debug("<><MainSceneLoader.LoadScene>In loading!");
                this.displayProgress    += 3;
                imageProgress.fillAmount = this.displayProgress / (float)100;
                yield return(new WaitForEndOfFrame());
            }
            FlurryUtil.LogEvent("Hank_Openani_View");
            GuLog.Debug("<><Preload>LoadOk!");
            this.objProgress.SetActive(false);
            this.videoPlayer.Play();
            this.bMovieEnd = false;
            yield return(new WaitUntil(() => bMovieEnd));

            op.allowSceneActivation = true;
        }
        private void OnP2PFail()
        {
            FlurryUtil.LogEvent("Friending_Search_Failed_Event");

            viewMainScene.MakeFriendFail();
            GuLog.Debug("<><MainSceneMediator><MakeFriend>_P2PFail!");
        }
Beispiel #3
0
 /// <summary>
 /// 水杯右侧上下来回滑动
 /// </summary>
 private void _CupRightSwipeUpDown()
 {
     if (!IsLockedKey(MainKeys.CupRightSwipeUpDown))
     {
         FlurryUtil.LogEvent(this.View, MainKeys.CupRightSwipeUpDown); this.CupRightSwipeUpDown();
     }
 }
        private bool MissionPercentProcess()
        {
            if (dataManager.missionPercent >= 1)
            {
                int expIncrease  = GetMissionCompleteExp();
                int coinIncrease = GetMissionCompleteCoin();
                this.FundDataManager.AddCoin(this.FundDataManager.GetCoinId(), coinIncrease);
                uiState.PushNewState(UIStateEnum.eRolePlayAction, "level_end");
                FlurryUtil.LogEvent("Mission_Finish_Petani_View");

                uiState.PushNewState(UIStateEnum.eMissionComplete, dataManager.missionId, expIncrease, true, coinIncrease);

                dataManager.exp += expIncrease;
                uiState.PushNewState(UIStateEnum.eExpIncrease, GetExpPercent());

                RefreshLevelAfterExpChange();

                missionDataManager.AddMissionState(dataManager.missionId, MissionState.eComplete);
                if (dataManager.IsMissionLimit())
                {
                    uiState.PushNewState(UIStateEnum.eMissionUpperLimitNotify);
                }
                else
                {
                    bool missionRetry = false;
                    dataManager.missionPercent = 0;
                    int sceneIndex    = missionConfig.GetSceneIndexByMissionID(dataManager.missionId);
                    int nextMissionId = missionConfig.GetNextMissionId(dataManager.missionId, true);
                    if (nextMissionId == -1)
                    {//如果已经到达此星球的最后一个关卡,则检查此星球是否为副本星球
                        WorldInfo worldInfo = this.missionConfig.GetWorldByStarID(this.dataManager.StarID);
                        if (worldInfo != null && worldInfo.Type == WorldInfo.WorldTypes.Duplicate)
                        {//副本星球的关卡是可以循环玩的,所以到达最后一个关卡后,再返回第一个关卡
                            missionRetry  = true;
                            nextMissionId = this.missionConfig.GetFirstMissionOfScene(this.dataManager.StarID, sceneIndex);
                            if (nextMissionId != -1)
                            {
                                this.missionDataManager.ClearAllMissionOfScene(this.dataManager.StarID, sceneIndex);//清除此星球当前地图的所有关卡记录
                            }
                        }
                    }

                    if (nextMissionId != -1)
                    {
                        FlurryUtil.LogEventWithParam("Mission_Finish_Event", "MissionID", dataManager.missionId.ToString());
                        missionDataManager.AddMissionState(nextMissionId, MissionState.eUnderway);
                        dataManager.missionId = nextMissionId;//这里要先把nextMissionId的eUnderWay状态记录下来,再改变dataManager的missionId,否则(eLock状态)写不进去
                        uiState.PushNewState(UIStateEnum.eNewMissionSwitch, dataManager.missionId);
                        uiState.PushNewState(UIStateEnum.eRolePlayAction, "level_start", 0, false);
                        if (missionRetry)
                        {
                            uiState.PushNewState(UIStateEnum.eMissionRetry, nextMissionId);
                        }
                    }
                }
                dataManager.TrySendPlayerData2Server();
                return(true);
            }
            return(false);
        }
Beispiel #5
0
 /// <summary>
 /// 水杯右侧拍两下
 /// </summary>
 private void _CupDoubleTapRight()
 {
     if (!IsLockedKey(MainKeys.CupDoubleTapRight))
     {
         FlurryUtil.LogEvent(this.View, MainKeys.CupDoubleTapRight); this.CupDoubleTapRight();
     }
 }
Beispiel #6
0
 /// <summary>
 /// 水杯左侧上划
 /// </summary>
 private void _CupLeftSwipeUp()
 {
     if (!IsLockedKey(MainKeys.CupLeftSwipeUp))
     {
         FlurryUtil.LogEvent(this.View, MainKeys.CupLeftSwipeUp); this.CupLeftSwipeUp();
     }
 }
Beispiel #7
0
 /// <summary>
 /// 水杯摇晃
 /// </summary>
 private void _CupShake()
 {
     if (!IsLockedKey(MainKeys.CupShake))
     {
         FlurryUtil.LogEvent(this.View, MainKeys.CupShake); this.CupShake();
     }
 }
Beispiel #8
0
 /// <summary>
 /// 水杯左侧拍一下
 /// </summary>
 private void _CupTapLeft()
 {
     if (!IsLockedKey(MainKeys.CupTapLeft))
     {
         FlurryUtil.LogEvent(this.View, MainKeys.CupTapLeft); this.CupTapLeft();
     }
 }
Beispiel #9
0
 /// <summary>
 /// 电源键长按
 /// </summary>
 private void _PowerHold()
 {
     if (!IsLockedKey(MainKeys.PowerHold))
     {
         FlurryUtil.LogEvent(this.View, MainKeys.PowerHold); this.PowerHold();
     }
 }
        public void powerKeyPressUp()
        {
            if (TopViewHelper.Instance.HasModulePageOpened())
            {
                return;
            }

            switch (crownIndex)
            {
            case 0:
            {
                FlurryUtil.LogEvent("Dailygoal_30_Exp_Collect_Click");
            }
            break;

            case 1:
            {
                FlurryUtil.LogEvent("Dailygoal_60_Exp_Collect_Click");
            }
            break;

            case 2:
            {
                FlurryUtil.LogEvent("Dailygoal_100_Exp_Collect_Click");
            }
            break;
            }

            uIStateCompleteSignal.Dispatch(GetStateEnum());
            if (dailyGoalBlur.activeInHierarchy && isIdle)
            {
                ExpDisappearAni();
            }
        }
        private void OnP2PSuccess(P2PInfo info)
        {
            FlurryUtil.LogEvent("Friending_Search_Success_Event");

            viewMainScene.MakeFriend(info.pet_type, (info.role == "1"));
            GuLog.Debug("<><MainSceneMediator><MakeFriend>_P2PSuccess!");
        }
Beispiel #12
0
        //顺序5
        private void WaterRiseAnimation()
        {
            FlurryUtil.LogEvent("Drink_Exp_Collect_ani_View");

            if (this.IsNormalStatus())
            {
                SoundPlayer.GetInstance().PlaySoundType("water_raise");
                if (drinkCoin > 0)
                {
                    SoundPlayer.GetInstance().PlaySoundType("gain_coin");
                }
            }

            expBall.SetActive(true);
            Scale(expBall.gameObject);

            if (missionProcess > 0.84)
            {
                expBall.GetComponent <Image>().DOFade(1, 0.01f);
            }
            award.gameObject.SetActive(true);
            int textLength = Mathf.Max(drinkExp.ToString().Length, drinkCoin.ToString().Length);

            expWord.text  = "+" + drinkExp.ToString().PadLeft(textLength, ' ');
            coinWord.text = "+" + drinkCoin.ToString().PadLeft(textLength, ' ');
            Sequence sDropSeq = DOTween.Sequence();

            sDropSeq.Append(expBall.transform.DOLocalMove(this.waterLevel.localPosition + new Vector3(-300, 240, 0), 1.5f).SetEase(Ease.OutQuad))
            .Append(expBall.GetComponent <Image>().DOFade(0, 0.5f))
            .Append(expBall.transform.DOLocalMove(this.waterLevel.localPosition, 0.01f));

            sDropSeq.onComplete = delegate()
            {
                expShiny.Play("ExpShiny");
            };

            award.DOFade(0.5f, 0.8f).SetLoops(3);
            float dest_pos_y = exp_pos_y + 70;

            if (missionProcess < 0.7)
            {
                dest_pos_y = this.waterLevel.localPosition.y + 20;
            }

            award.transform.DOLocalMoveY(dest_pos_y, 2.4f).onComplete = delegate()
            {
                award.DOFade(0, 1.0f).onComplete = delegate()
                {
                    award.transform.DOMoveY(exp_pos_y, 0.5f);
                };
                drinkExp = 0;
                SetFinishAndOpenScreenSave(true);
                uIStateCompleteSignal.Dispatch(GetStateEnum());
            };

            sliderWave.DOValue(missionProcess, 1.0f).onComplete = delegate()
            {
            };
        }
Beispiel #13
0
 //右拍
 public void TapRight()
 {
     if (IsNormalStatus())
     {
         rolePlayer.Play("right_tap");
         FlurryUtil.LogEvent("Petscreen_right_tap_event");
     }
 }
Beispiel #14
0
 //右侧上下划
 public void RightSwipeUpAndDown()
 {
     GuLog.Debug("<><MainSceneView>onRightSwipeUpAndDown");
     if (IsNormalStatus())
     {
         this.rolePlayer.Play("right_updown");
         FlurryUtil.LogEvent("Petscreen_right_updown_event");
     }
 }
        public void ScreenOn()
        {
            FlurryUtil.LogEvent("Screen_On_daily_count");

            if (myCoroutine != null)
            {
                StopCoroutine(myCoroutine);
                myCoroutine = null;
            }
            StartCheckDayChangeCoroutine();
            CheckNewDay();
        }
Beispiel #16
0
        //下划
        public void SwipeDown()
        {
            //GuLog.Debug("<><MainSceneView>onRightSwipeDown");
            //if (IsNormalStatus())
            //{
            //    rolePlayer.Play("right_down");
            //    FlurryUtil.LogEvent("Petscreen_right_swipedown_event");
            //}

            GuLog.Debug("<><MainSceneView>onRightSwipeDown");
            FlurryUtil.LogEvent("Petscreen_right_swipedown_event");
            this.Navigator.TurnRight();
        }
Beispiel #17
0
        public override void Stop()
        {
            base.Stop();
            FlurryUtil.LogEvent("Nim_Chest_open_event");
            if (!TopViewHelper.Instance.HasModulePageOpened() || TopViewHelper.Instance.IsInGuideView())
            {
                SoundPlayer.GetInstance().PlaySoundType("nim_chest_get_nim");
            }

            this.missionBackground.PlayNimAnimation(treasureBoxIndex, missionId);
            bFinish = true;
            gameObject.SetActive(false);
        }
Beispiel #18
0
        public override void ProcessState(UIState state)
        {
            Debug.Log("<><SchoolMode><>----enter school mode");
            FlurryUtil.LogEvent("Petscreen_Schoolmode_enter_ani_View");
            bFinish = false;
            gameObject.SetActive(true);

            processBar.setAwardAndHandle(dataManager.percentOfDailyGoal);

            dataManager.SetVolumeZero();

            endTime = DateTime.Now.AddSeconds((float)state.value0);
            Debug.Log("<><SchoolMode><>EndTime: " + endTime.ToShortTimeString());
            this.SchoolModeTimeInSignal.Dispatch();
        }
        private void ShowLowBattery(BatteryStatus lowBattery)
        {
            myStatus = lowBattery;

            if (myStatus == BatteryStatus.LowBattery_10)
            {
                FlurryUtil.LogEvent("Petscreen_LowBattery_10_Ani_View");
            }
            else
            {
                FlurryUtil.LogEvent("Petscreen_LowBattery_20_Ani_View");
            }
            if (this.PlayerDataManager.LanguageInitialized())//设置过语言后才能播放此声音
            {
                SoundPlayer.GetInstance().PlaySoundType("system_charging_low_battery_in");
            }

            if (TopViewHelper.Instance.IsInGuideView())
            {
                ShowSmallBatteryIcon();
            }
            else
            {
                lowBatteryGp.AnimationState.ClearTracks();
                smallBattery.SetActive(false);
                backBtn.SetActive(true);
                backImg.gameObject.SetActive(true);
                backImg.DOFade(0.8f, 0.5f);
                lowBatteryGp.gameObject.SetActive(true);
                lowBatteryGp.AnimationState.SetAnimation(1, "enter_" + GetPostfixOfAnimation(), false);
                lowBatteryGp.AnimationState.Complete += delegate(TrackEntry trackEntry)
                {
                    if (trackEntry.trackIndex == 1)
                    {
                        lowBatteryGp.AnimationState.ClearTracks();
                        lowBatteryGp.AnimationState.SetAnimation(3, "idle_" + GetPostfixOfAnimation(), true);
#if (UNITY_ANDROID) && (!UNITY_EDITOR)
                        CupKeyEventHookStaticManager.addPowerKeyPressCallBack(PowerKeyPressUp);
#endif
                    }
                };
                TopViewHelper.Instance.AddTopView(TopViewHelper.ETopView.eLowBattary);
            }
        }
Beispiel #20
0
        IEnumerator DelayOneFrameForEnd()
        {
            bFinish = true;
            FlurryUtil.LogEvent("Petscreen_Schoolmode_exit_ani_View");
            //Debug.Log("<><SchoolMode><>----exit school mode0");

            yield return(null);

            myCoroutine = null;
            gameObject.SetActive(false);
            Debug.Log("<><SchoolMode><>----exit school mode");

            dataManager.RecoverVolume();
            processFreshNewsSignal.Dispatch();

            if (!this.uiState.IsExistState(UIStateEnum.eRefreshMainByData))
            {
                this.uiState.PushNewState(UIStateEnum.eRefreshMainByData);
            }
        }
        public void PowerKeyPressUp()
        {
            if (TopViewHelper.Instance.HasModulePageOpened())
            {
                return;
            }

            FlurryUtil.LogEvent("Mission_Finish_Collectionpage_Click");
            if (is_loop)
            {
                this.missionComplete.AnimationState.ClearTracks();
                this.missionComplete.gameObject.SetActive(false);
                if (this.worldTypes == WorldInfo.WorldTypes.Normal)
                {
                    this.uiNormalMission.SetStatus(true);
                    this.uiNormalMission.RectTransform.DOLocalMoveY(0f, 0.5f).onComplete = delegate()
                    {
                        this.is_loop  = false;
                        this.can_hide = true;
                    };
                }
                else if (this.worldTypes == WorldInfo.WorldTypes.Duplicate)
                {
                    this.uiDuplicateMission.SetStatus(true);
                    this.uiDuplicateMission.RectTransform.DOLocalMoveY(0f, 0.5f).onComplete = delegate()
                    {
                        this.is_loop  = false;
                        this.can_hide = true;
                    };
                }
                SoundPlayer.GetInstance().PlaySoundType("mission_complete_board_fly_in");
            }
            if (this.can_hide)
            {
                this.can_hide = false;
                this.bFinish  = true;
                this.gameObject.SetActive(false);
                this.uiNormalMission.SetStatus(false);
                this.uiDuplicateMission.SetStatus(false);
            }
        }
        //当配饰变化时
        private void OnAccessoryChanged(Accessory currentAccessory, Accessory lastAccessory)
        {
            RoleManager.Instance.ResetAccessoriesAndMates();
            RoleManager.Instance.CurrentRole.HideParticleEffect();
            RoleManager.Instance.Mates.ForEach(t => t.HideParticleEffect());
            //不管当前是什么配饰,都需要先脱掉与其相同类型或部位的配饰
            List <Accessory> accessories = this.LocalPetAccessoryAgent.GetAccessoriesByType(this.PlayerDataManager.CurrentPet, currentAccessory.Type);

            if (accessories != null && accessories.Count > 0)
            {
                foreach (var accessory in accessories.ToArray())
                {
                    this.TakeOff(accessory, false);
                }
            }

            if (currentAccessory.Suitable(this.PlayerDataManager.CurrentPet))
            {
                this.PutOn(currentAccessory, false);
            }
            FlurryUtil.LogEvent("mall_scene_switch_item_event");
        }
        private void OnDrinkWater(int intake, long drinkDuration)
        {
            if (TopViewHelper.Instance.IsInGuideView() || TopViewHelper.Instance.IsOpenedView(TopViewHelper.ETopView.eLanguageSetting))
            {
                GuLog.Debug("<><MainSceneView>eNoviceGuide is top!");
                return;
            }

            if (DrinkUtils.isValidDrink(intake, drinkDuration))
            {
                GuLog.Debug("<><MainSceneMediator>DrinkWaterCallback intake:<><>" + intake + "   drinkDuration:" + drinkDuration);
                FlurryUtil.LogEvent("Drink_Daily_count");

                dataProcess.DrinkWater(intake);
                dataManager.TodayDrinkTimes += 1;
            }
            else
            {
                dataProcess.DrinkFail();
            }
            closeSystemMenuSignal.Dispatch();
        }
        private void saveData(RegisterResponseData info)
        {
            if (!string.IsNullOrEmpty(info.x_child_sn))
            {
                //Debug.LogFormat("--------SaveSN--------RegisterCupService.saveData: {0}", info.x_child_sn);
                mLocalChildInfoAgent.saveChildSN(info.x_child_sn);
                FlurryUtil.LogEvent("Pair_Get_Childsn_Sunccess_Event");
            }
            else
            {
                FlurryUtil.LogEvent("Pair_Get_Childsn_Fail_Event");
                GuLog.Warning("pair data childsn is null");
            }

            //删除本地数据
            this.LocalPetInfoAgent.Clear();
            GuLog.Debug("<><RegisterCupService>Clear currentPet");
            this.LocalUnlockedPetsAgent.Clear();
            GuLog.Debug("<><RegisterCupService>Clear unlockedPets");

            //保存网络数据
            //mLocalCupAgent.saveCupToken(CupBuild.getCupSn(), info.token);
            mNativeDataManager.saveToken(info.token);
            mLocalCupAgent.saveCupID(CupBuild.getCupSn(), info.x_cup_sn);
            LocalPetInfoAgent.saveCurrentPet(info.pet_model);
            //重新保存语言数据
            this.PlayerDataManager.SaveLanguage(this.PlayerDataManager.Language);

            if (info.timestamp > 0)
            {
                mTimeManager.setServerTime(info.timestamp * (1000L));
            }

            if (!string.IsNullOrEmpty(info.timezone))
            {
                mTimeManager.setTimeZone(info.timezone);
            }
        }
        void AddIntake(int intake)
        {
            if (TreasureBoxProcess())
            {
                bTrigger = true;
            }

            if (DailyGoalPercentProcess(intake))
            {
                bTrigger = true;
            }

            if (MissionPercentProcess())
            {
                bTrigger = true;
            }

            if (!bTrigger)
            {
                uiState.PushNewState(UIStateEnum.eRolePlayAction, "DrinkSuccess", 0, false);
                FlurryUtil.LogEvent("Drink_PET_ani_view");
            }
        }
Beispiel #26
0
        private void SelectSubModule()
        {
            this.UnregisterInput();
            TopViewHelper.Instance.RemoveView(this.View);//����Ҫ�ȳ�ջ����ΪMainMenu�Ķ�Ч���ӳ�View��ջ
            switch (MainMenuView.CurrentTask)
            {
            case MainMenuView.Tasks.Achievement:
                this.dispatcher.Dispatch(MainEvent.OpenView, TopViewHelper.ETopView.eAchievement);
                break;

            case MainMenuView.Tasks.Cup:
                FlurryUtil.LogEvent("navmenu_system_page_click");
                this.dispatcher.Dispatch(MainEvent.OpenView, TopViewHelper.ETopView.eSystemMenu);
                break;

            case MainMenuView.Tasks.Home:
                FlurryUtil.LogEvent("navmenu_home_click");
                this.dispatcher.Dispatch(MainEvent.OpenView, TopViewHelper.ETopView.eHome);
                break;

            case MainMenuView.Tasks.Collection:
                FlurryUtil.LogEvent("navmenu_collection_page_click");
                this.dispatcher.Dispatch(MainEvent.OpenView, TopViewHelper.ETopView.eCollection);
                break;

            case MainMenuView.Tasks.Friend:
                this.dispatcher.Dispatch(MainEvent.OpenView, TopViewHelper.ETopView.eFriend);
                break;

            case MainMenuView.Tasks.Pet:
                FlurryUtil.LogEvent("navmenu_store_page_click");
                this.dispatcher.Dispatch(MainEvent.OpenView, TopViewHelper.ETopView.ePetPage);
                break;
            }
            this.MainMenuView.Close(() => dispatcher.Dispatch(MainEvent.CloseMainMenu, TopViewHelper.ETopView.eMainMenu));
        }
        void Awake()
        {
            BatteryUtils.init();
            FlurryUtil.Init();
            AsyncActionHelper.Instance.init();
            FlurryUtil.SetUserId(CupBuild.getCupSn());
            FlurryUtil.LogEvent("Hank_Splashscreen_View");
            Screen.sleepTimeout = SleepTimeout.NeverSleep;
            GameObject objGlobalContextView = null; /*= GameObject.Find("GlobalContextView");
                                                     * if (objGlobalContextView == null)*/

            {
                objGlobalContextView      = new GameObject();
                objGlobalContextView.name = "GlobalContextView";
                GlobalContextView globalContextView = objGlobalContextView.AddComponent <GlobalContextView>();
                GameObject.DontDestroyOnLoad(globalContextView);
            }
#if (UNITY_IOS || UNITY_ANDROID) && (!UNITY_EDITOR)
#if WETEST_SDK
            objGlobalContextView.AddComponent <WeTest.U3DAutomation.U3DAutomationBehaviour>();
            BuglyAgent.RegisterLogCallback(WeTest.U3DAutomation.CrashMonitor._OnLogCallbackHandler);
#endif
#endif
        }
        private void LowBatteryUpdate()
        {
#if (UNITY_ANDROID) && (!UNITY_EDITOR)
            int batteryCapacity = BatteryUtils.getBatteryCapacity(AndroidContextHolder.GetAndroidContext());
#else
            int batteryCapacity = 15;
#endif
            //GuLog.Info("<lowbattery><>batteryCapacity<><>" + batteryCapacity.ToString());

            switch (myStatus)
            {
            case BatteryStatus.Normal:
            {
                if (batteryCapacity >= 10 && batteryCapacity < 20)
                {
                    ShowLowBattery(BatteryStatus.LowBattery_20);
                }
                else if (batteryCapacity < 10)
                {
                    ShowLowBattery(BatteryStatus.LowBattery_10);
                }
            }
            break;

            case BatteryStatus.LowBattery_20:
            {
                if (batteryCapacity >= 20)
                {
                    FlurryUtil.LogEvent("LowBattery_20_Event");

                    lowBatteryGp.AnimationState.ClearTracks();
                    HideAll();
                    myStatus = BatteryStatus.Normal;
                }
                else if (batteryCapacity < 10)
                {
                    ShowLowBattery(BatteryStatus.LowBattery_10);
                }
            }
            break;

            case BatteryStatus.LowBattery_10:
            {
                if (batteryCapacity >= 20)
                {
                    FlurryUtil.LogEvent("LowBattery_20_Event");
                    FlurryUtil.LogEvent("LowBattery_10_Event");

                    lowBatteryGp.AnimationState.ClearTracks();
                    HideAll();
                    myStatus = BatteryStatus.Normal;
                }
                if (batteryCapacity >= 10 && batteryCapacity < 20)
                {
                    FlurryUtil.LogEvent("LowBattery_10_Event");

                    ShowLowBattery(BatteryStatus.LowBattery_20);
                }
            }
            break;
            }
        }
Beispiel #29
0
 //前一个任务
 public void OnPreMission()
 {
     GuLog.Debug("<><MainSceneView>goPreMission");
     this.goPreMissionSignal.Dispatch();
     FlurryUtil.LogEvent("Petscreen_left_swipedown_event");
 }
        public void PushNewState(UIState state)
        {
            if (state.state == UIStateEnum.eStartDailyProcessBar || state.state == UIStateEnum.eDrinkFail)
            {
                if (IsExistState(state.state))
                {
                    return;
                }
            }
            if (state.state == UIStateEnum.eRefreshMainByData)
            {
                RemoveSameState(state);
            }
            if (state.state == UIStateEnum.eMissionComplete)
            {
                FlurryUtil.LogEvent("Mission_Daily_count");
            }
            else if (state.state == UIStateEnum.eTreasureBoxOpen)
            {
                FlurryUtil.LogEvent("Nim_Chest_Open_daily_count");
            }
            else if (state.state == UIStateEnum.eDailyGoalCrownComplete)
            {
                switch ((int)state.value0)
                {
                case 0:
                {
                    FlurryUtil.LogEvent("Dailygoal_30_Archived_Event");
                }
                break;

                case 1:
                {
                    FlurryUtil.LogEvent("Dailygoal_60_Archived_Event");
                }
                break;

                case 2:
                {
                    FlurryUtil.LogEvent("Dailygoal_100_Archived_Event");
                }
                break;
                }
            }

            if (IsSilenceMode(state.state))
            {
                MainPresentBase present = GetPresentByEnum(state.state);
                if (present != null)
                {
                    present.ProcessState(state);
                }

                if (CurrentPresent == null)
                {
                    listState.Clear();
                    CurrentPresent = present;
                    return;
                }
                else
                {
                    if (!IsSilenceMode(CurrentPresent.GetStateEnum()))
                    {
                        ClearState();
                        CurrentPresent = present;
                        return;
                    }
                }
            }
            else if (CurrentPresent != null && IsSilenceMode(CurrentPresent.GetStateEnum()))
            {
                if (state.state != UIStateEnum.eRefreshMainByData && state.state != UIStateEnum.eStartDailyProcessBar)
                {
                    if (state.state == UIStateEnum.eDropWaterAni)
                    {
                        if (CurrentPresent.GetStateEnum() == UIStateEnum.eSchoolMode)
                        {
                            FlurryUtil.LogEvent("Drink_In_Schoolmode_Daily_Count");
                        }
                        else if (CurrentPresent.GetStateEnum() == UIStateEnum.eSleepMode)
                        {
                            FlurryUtil.LogEvent("Drink_In_Sleepmode_Daily_Count");
                        }
                    }
                    else if (state.state == UIStateEnum.eDailyProcessIncrease || state.state == UIStateEnum.eMissionFadeInOut)
                    {
                        MainPresentBase present = GetPresentByEnum(state.state);
                        if (present != null)
                        {
                            present.ProcessState(state);
                        }
                    }
                    return;
                }
            }
            if (state.state == UIStateEnum.eDropWaterAni)
            {
                FlurryUtil.LogEvent("Drink_Nomal_Daily_Count");
            }

            listState.Add(state);
        }