Exemplo n.º 1
0
        /// <summary>
        /// 解析数据
        /// </summary>
        /// <param name="data">数据</param>
        private void ParstData(Hashtable data)
        {
            ClimingTowerInfo currentLayerInfo = new ClimingTowerInfo();

            currentLayerInfo.v_CurrentLayer = int.MaxValue;
            //
            currentLayerInfo.v_SleepHero = EBCore.Dot.Array <int>("ban_list", data, currentLayerInfo.v_SleepHero,
                                                                  delegate(object val)
            {
                return(int.Parse(val.ToString()));
            });
            currentLayerInfo.last_reset_day = EB.Dot.Integer("last_reset_day", data, 0);
            currentLayerInfo.last_reset_ts  = EB.Dot.Integer("last_reset_ts", data, 0);
            currentLayerInfo.recordPoint    = EB.Dot.Integer("totalScore", data, 0);
            //获取活动天数
            int activityDay = (int)NewGameConfigTemplateManager.Instance.GetGameConfigValue("SleepTower");

            currentLayerInfo.v_ResetTime      = currentLayerInfo.last_reset_ts + activityDay * 24 * 60 * 60;
            currentLayerInfo.v_TodayResetTime = EB.Dot.Integer("last_ban_ts", data, 0) + 24 * 60 * 60;
            currentLayerInfo.v_TodayResetTime = EB.Dot.Integer("last_ban_ts", data, 0) + 24 * 60 * 60;

            Hashtable levelData = EB.Dot.Object("init_data", data, null);

            currentLayerInfo.v_Level = EB.Dot.Integer("level", levelData, 30);
            //
            data = EB.Dot.Object("tower", data, null);
            foreach (DictionaryEntry entry in data)
            {
                ClimingTowerTemplate template = new ClimingTowerTemplate();
                var floor = int.Parse(entry.Key.ToString());
                template.layer = floor;
                bool finish           = EB.Dot.Bool("finish", entry.Value, false);
                bool diffculty_finish = EB.Dot.Bool("diffculty_finish", entry.Value, false);
                finish = finish || diffculty_finish;

                if (currentLayerInfo.v_CurrentLayer > floor && !finish)
                {
                    currentLayerInfo.v_CurrentLayer = floor;
                    currentLayerInfo.v_Layout       = EB.Dot.String("layout", entry.Value, "");
                }
            }

            int    sleepRedPoint = 0;
            string key           = LoginManager.Instance.LocalUserId.Value + "SleepTowerHud" + EB.Time.LocalMonth + EB.Time.LocalDay;
            int    value         = PlayerPrefs.GetInt(key);

            if (value == 0 && currentLayerInfo.v_CurrentLayer < data.Count)
            {
                sleepRedPoint++;
            }

            sleepRedPoint = GetRewardRedPoint() ? sleepRedPoint + 1 : sleepRedPoint;
            LTRedPointSystem.Instance.SetRedPointNodeNum(RedPointConst.climingtower, sleepRedPoint);
        }
Exemplo n.º 2
0
        private KeyValuePair <ClimingTowerInfo, List <Hotfix_LT.Data.ClimingTowerTemplate> > ParstData(Hashtable data)
        {
            if (data == null)
            {
                return(new KeyValuePair <ClimingTowerInfo, List <Hotfix_LT.Data.ClimingTowerTemplate> >(null, null));
            }
            //
            ClimingTowerInfo currentLayerInfo = new ClimingTowerInfo();

            currentLayerInfo.v_CurrentLayer = int.MaxValue;
            //
            currentLayerInfo.v_SleepHero = Hotfix_LT.EBCore.Dot.Array <int>("ban_list", data, currentLayerInfo.v_SleepHero,
                                                                            delegate(object val)
            {
                return(int.Parse(val.ToString()));
            });
            currentLayerInfo.last_reset_day = EB.Dot.Integer("last_reset_day", data, 0);
            currentLayerInfo.last_reset_ts  = EB.Dot.Integer("last_reset_ts", data, 0);
            currentLayerInfo.recordPoint    = EB.Dot.Integer("totalScore", data, 0);
            //获取活动天数
            int activityDay = (int)Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("SleepTower");

            currentLayerInfo.v_ResetTime      = currentLayerInfo.last_reset_ts + activityDay * 24 * 60 * 60;
            currentLayerInfo.v_TodayResetTime = EB.Dot.Integer("last_ban_ts", data, 0) + 24 * 60 * 60;
            currentLayerInfo.v_TodayResetTime = EB.Dot.Integer("last_ban_ts", data, 0) + 24 * 60 * 60;

            recordLabel.text = EB.Localizer.GetString("ID_SLEEPTOWER_RECORD") + currentLayerInfo.recordPoint;
            Hashtable levelData = EB.Dot.Object("init_data", data, null);

            currentLayerInfo.v_Level = EB.Dot.Integer("level", levelData, 30);
            //
            data = EB.Dot.Object("tower", data, null);
            List <Hotfix_LT.Data.ClimingTowerTemplate> allLayerData = new List <Hotfix_LT.Data.ClimingTowerTemplate>();

            foreach (DictionaryEntry entry in data)
            {
                Hotfix_LT.Data.ClimingTowerTemplate template = new Hotfix_LT.Data.ClimingTowerTemplate();

                var floor = int.Parse(entry.Key.ToString());
                template.layer = floor;
                bool finish           = EB.Dot.Bool("finish", entry.Value, false);
                bool diffculty_finish = EB.Dot.Bool("diffculty_finish", entry.Value, false);
                finish = finish || diffculty_finish;
                if (currentLayerInfo.v_CurrentLayer > floor && !finish)
                {
                    currentLayerInfo.v_CurrentLayer = floor;
                    currentLayerInfo.v_Layout       = EB.Dot.String("layout", entry.Value, "");
                }
                allLayerData.Add(template);
            }
            return(new KeyValuePair <ClimingTowerInfo, List <Hotfix_LT.Data.ClimingTowerTemplate> >(currentLayerInfo, allLayerData));
        }
Exemplo n.º 3
0
 private void SetPanel(ClimingTowerInfo data, List <Hotfix_LT.Data.ClimingTowerTemplate> climingTowerTemplates)
 {
     v_CurrentLayerData = data;
     LTClimingTowerManager.Instance.v_CurrentLayerData = v_CurrentLayerData;
     m_ServerLayerData = climingTowerTemplates;
     if (data == null)
     {
         MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTHeroBattleMatchHudController_10973"));
         return;
     }
     //创建塔层,说明已经都打通关了
     SetLayer(data, data.v_CurrentLayer == int.MaxValue);
     //设置倒计时间
     if (m_ResetTimeCoroutine != null)
     {
         StopCoroutine(m_ResetTimeCoroutine);
         m_ResetTimeCoroutine = null;
     }
     if (controller.gameObject.activeSelf)
     {
         m_ResetTimeCoroutine = StartCoroutine(SetResetTime(data.v_ResetTime, data.v_TodayResetTime));
     }
 }
Exemplo n.º 4
0
        private void SetLayer(ClimingTowerInfo data, bool isAllPass)
        {
            if (v_StyleLayer != null)
            {
                for (int i = 0; i < v_StyleLayer.Length; i++)
                {
                    v_StyleLayer[i].v_HaveSetData = false;
                }
            }

            //拿塔的数据,拿4层就可以了
            int total = 4;
            List <Data.ClimingTowerTemplate> datas = Data.EventTemplateManager.Instance.GetClimingTowerData(data.v_Level, isAllPass ? 20 : data.v_CurrentLayer, total);

            if (datas != null && datas.Count > 0)
            {
                Data.ClimingTowerTemplate layerData       = null;
                LTClimingTowerLayer       layerController = null;
                int result = (datas[0].layer % 2 == 0) ? 0 : 1;

                for (int i = 0; i < total; i++)
                {
                    //层的数据
                    if (datas.Count > i)
                    {
                        layerData = datas[i];
                        SetLayerState(ref layerData);
                    }
                    else
                    {
                        layerData = null;
                    }

                    //设置层的界面
                    layerController = v_StyleLayer[i];

                    if (layerController != null)
                    {
                        layerController.mDMono.gameObject.name = (total - i).ToString();
                        if (layerData != null)
                        {
                            layerController.F_SetData(v_Api.RequestChallengeLayer, isAllPass ? null : layerData, layerData.layer);
                        }
                    }
                }
            }

            if (v_Grid != null)
            {
                v_Grid.Reposition();
            }

            if (v_TweenPosition != null)
            {
                v_TweenPosition.to = (data != null && data.v_CurrentLayer == 1) ? EndPos.localPosition : EndPos2.localPosition;

                var tweenAlpha = v_TweenPosition.GetComponent <TweenAlpha>();

                if (tweenAlpha != null)
                {
                    tweenAlpha.ResetToBeginning();
                    tweenAlpha.PlayForward();
                }

                v_TweenPosition.ResetToBeginning();
                v_TweenPosition.PlayForward();
            }
        }