Ejemplo n.º 1
0
        public void InitSkillInfo(LTPartnerData itemData)
        {
            if (itemData == null)
            {
                return;
            }

            partnerData = itemData;
            SkillSetTool.SkillFrameStateSet(commonsprite, false);
            SkillSetTool.SkillFrameStateSet(passivesprite, false);
            SkillSetTool.SkillFrameStateSet(activesprite, false);
            skillLevelUptpl = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroAwakeInfoByInfoID(partnerData.InfoId);
            Data.SkillTemplate commonSkillTem = Data.SkillTemplateManager.Instance.GetTemplateWithAwake(partnerData,
                                                                                                        partnerData.HeroStat.common_skill, () => { SkillSetTool.SkillFrameStateSet(commonsprite, true); });
            Data.SkillTemplate passiveSkillTem = Data.SkillTemplateManager.Instance.GetTemplateWithAwake(partnerData,
                                                                                                         partnerData.HeroStat.passive_skill, () => { SkillSetTool.SkillFrameStateSet(passivesprite, true); });
            Data.SkillTemplate activeSkillTem = Data.SkillTemplateManager.Instance.GetTemplateWithAwake(partnerData,
                                                                                                        partnerData.HeroStat.active_skill, () => { SkillSetTool.SkillFrameStateSet(activesprite, true); });

            CommonSkillBreakSprite.spriteName  = commonSkillTem.Icon;
            CommonSkillLevel.text              = partnerData.CommonSkillLevel.ToString();
            PassiveSkillBreakSprite.spriteName = passiveSkillTem.Icon;
            PassiveSkillLevel.text             = partnerData.PassiveSkillLevel.ToString();
            ActiveSkillBreakSprite.spriteName  = activeSkillTem.Icon;
            ActiveSkillLevel.text              = partnerData.ActiveSkillLevel.ToString();
        }
Ejemplo n.º 2
0
        public override void SetMenuData(object param)
        {
            base.SetMenuData(param);
            data = LTInstanceMapModel.Instance.scrollData;
            for (int i = 0; i < data.list.Length; i++)
            {
                Data.SkillTemplate skillTpl = Data.SkillTemplateManager.Instance.GetTemplate(data.list[i]);
                ReelItems[i].icon.spriteName = skillTpl.Icon;
                LTUIUtil.SetText(ReelItems[i].title, skillTpl.Name);
                LTUIUtil.SetText(ReelItems[i].desc, skillTpl.Description);
            }

            isFirst = true;
            RegisterMonoUpdater();
            // PlayStartAnim();
        }
Ejemplo n.º 3
0
        public void InitData()
        {
            LTEquipmentWishItem selectedItem = null;

            // 显示周一到周五的掉落奖励
            for (var i = 1; i <= 5; i++)
            {
                Data.LostChallengeRewardTemplate temp = Data.SceneTemplateManager.Instance.GetLostChallengeReward((System.DayOfWeek)i, Data.SceneTemplateManager.Instance.LostChallengeRewardMaxFloor);

                if (temp == null || temp.DropList == null)
                {
                    continue;
                }

                for (int j = 0; j < temp.DropList.Count; j++)
                {
                    int id;

                    if (int.TryParse(temp.DropList[j], out id))
                    {
                        int suit = id % 100;
                        Data.SuitTypeInfo suitInfo = Data.EconemyTemplateManager.Instance.GetSuitTypeInfoByEcidSuitType(suit);

                        if (suitInfo != null)
                        {
                            var go = GameObject.Instantiate <GameObject>(_itemTemplate, _uiGrid.transform);
                            var equipmentWishItem = go.GetMonoILRComponent <LTEquipmentWishItem>();
                            equipmentWishItem.SetIcon(suitInfo.SuitIcon);
                            equipmentWishItem.SetName(string.Format("{0}{1}", suitInfo.TypeName, EB.Localizer.GetString("ID_SUIT")));
                            equipmentWishItem.ItemId = id;

                            if (suitInfo.SuitAttr2 != 0)
                            {
                                Data.SkillTemplate suitAttr = Data.SkillTemplateManager.Instance.GetTemplate(suitInfo.SuitAttr2);//套装2
                                equipmentWishItem.SetDesc(string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentSuitInfoItem_1348"), suitAttr.Description));
                            }
                            else if (suitInfo.SuitAttr4 != 0)
                            {
                                Data.SkillTemplate suitAttr = Data.SkillTemplateManager.Instance.GetTemplate(suitInfo.SuitAttr4);//套装4
                                equipmentWishItem.SetDesc(string.Format(EB.Localizer.GetString("ID_codefont_in_LTEquipmentSuitInfoItem_1621"), suitAttr.Description));
                            }

                            go.SetActive(true);
                            _uiGrid.Reposition();

                            int itemId;

                            if (DataLookupsCache.Instance.SearchIntByID(string.Format("tl_acs.{0}.current", equipmentWishActivityId), out itemId) && id == itemId)
                            {
                                selectedItem = equipmentWishItem;
                            }
                        }
                    }
                }
            }

            _isInit = true;

            if (selectedItem != null)
            {
                var toggle = selectedItem.mDMono.transform.GetComponent <UIToggle>();

                if (toggle != null)
                {
                    toggle.startsActive = true;
                }
            }
        }
Ejemplo n.º 4
0
        private void UpdateUI()
        {
            if (curPartnerData == null)
            {
                return;
            }

            SkillSetTool.SkillFrameStateSet(CommonFrame, false);
            SkillSetTool.SkillFrameStateSet(PassiveFrame, false);
            SkillSetTool.SkillFrameStateSet(ActiveFrame, false);

            Data.SkillTemplate skill1 = Data.SkillTemplateManager.Instance.GetTemplateWithAwake(curPartnerData,
                                                                                                curPartnerData.HeroStat.common_skill,
                                                                                                () => { SkillSetTool.SkillFrameStateSet(CommonFrame, true); });
            Data.SkillTemplate skill2 = Data.SkillTemplateManager.Instance.GetTemplateWithAwake(curPartnerData,
                                                                                                curPartnerData.HeroStat.active_skill,
                                                                                                () => { SkillSetTool.SkillFrameStateSet(ActiveFrame, true); });
            Data.SkillTemplate skill3 = Data.SkillTemplateManager.Instance.GetTemplateWithAwake(curPartnerData,
                                                                                                curPartnerData.HeroStat.passive_skill,
                                                                                                () => { SkillSetTool.SkillFrameStateSet(PassiveFrame, true); });
            maxSkillLevel = LTPartnerConfig.MAX_SKILL_LEVEL;

            if (skill1 != null)
            {
                CommonSkillIcon.transform.parent.gameObject.CustomSetActive(true);
                CommonSkillIcon.spriteName = skill1.Icon;
                CommonSkillTypeLab.text    = GetSkillTypeStr(skill1.Type);
            }
            else
            {
                CommonSkillIcon.transform.parent.gameObject.CustomSetActive(false);
            }

            if (skill2 != null)
            {
                ActiveSkillIcon.transform.parent.gameObject.CustomSetActive(true);
                ActiveSkillIcon.spriteName = skill2.Icon;
                ActiveSkillTypeLab.text    = GetSkillTypeStr(skill2.Type);
            }
            else
            {
                ActiveSkillIcon.transform.parent.gameObject.CustomSetActive(false);
            }
            if (skill3 != null)
            {
                PassiveSkillTypeLab.transform.parent.gameObject.CustomSetActive(true);
                PassiveSkillIcon.spriteName = skill3.Icon;
                PassiveSkillTypeLab.text    = GetSkillTypeStr(skill3.Type);
            }
            else
            {
                PassiveSkillTypeLab.transform.parent.gameObject.CustomSetActive(false);
            }

            ActiveSkillLevel.text  = curPartnerData.ActiveSkillLevel.ToString();
            CommonSkillLevel.text  = curPartnerData.CommonSkillLevel.ToString();
            PassiveSkillLevel.text = curPartnerData.PassiveSkillLevel.ToString();

            curSkillExp = LTPartnerDataManager.Instance.GetPartnerCurSkillLevelExp(curPartnerData.StatId, CurSelect);

            addSkillExp = 0;
            LTPartnerDataManager.Instance.ClearSkillBreakDelGoodsDic();
            if (CurSelect == SkillType.Active)
            {
                skillLevel       = curPartnerData.ActiveSkillLevel;
                curSelectSkillId = curPartnerData.HeroStat.active_skill;
                nextSkillExp     = LTPartnerConfig.SKILL_BREAK_LEVEL_EXP_DIC[curPartnerData.ActiveSkillLevel];
            }
            else if (CurSelect == SkillType.Common)
            {
                skillLevel       = curPartnerData.CommonSkillLevel;
                curSelectSkillId = curPartnerData.HeroStat.common_skill;
                nextSkillExp     = LTPartnerConfig.SKILL_BREAK_LEVEL_EXP_DIC[curPartnerData.CommonSkillLevel];
            }
            else if (CurSelect == SkillType.Passive)
            {
                skillLevel       = curPartnerData.PassiveSkillLevel;
                curSelectSkillId = curPartnerData.HeroStat.passive_skill;
                nextSkillExp     = LTPartnerConfig.SKILL_BREAK_LEVEL_EXP_DIC[curPartnerData.PassiveSkillLevel];
            }

            LevelLabel.text          = string.Format(EB.Localizer.GetString("ID_codefont_in_LTPartnerSkillBreakController_7019"), skillLevel);
            CurSelectSkillLevel.text = skillLevel.ToString();

            ShowGoodsList();
            ShowSkillBar();

            if (curSelectSkillId <= 0)
            {
                return;
            }
            SetSkillDes(skillLevel);
            //Hotfix_LT.Data.SkillTemplate tpl = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(curSelectSkillId);
            //if (tpl != null)
            //{
            //    //CurSelectSkillIcon.spriteName = tpl.Icon;
            //    //NameLabel.text = tpl.Name;
            //    DescLabel.text = GetContext(tpl, skillLevel);
            //}
            //LTUIUtil.SetText(DescAdditionalLabel, GetSkillAdditional(curSelectSkillId, skillLevel));

            Bounds bounds      = NGUIMath.CalculateRelativeWidgetBounds(SkillDescScroll.transform);
            bool   isCouldRoll = bounds.size.y + 40 > SkillDescScroll.panel.GetViewSize().y;

            SkillDescScroll.enabled = isCouldRoll;

            /*List<LTPartnerData> list = new List<LTPartnerData>();
             * for (int i = 0; i < 13; i++)
             * {
             *  LTPartnerData a = new LTPartnerData();
             *  list.Add(a);
             * }
             *
             * Scroll.SetItemDatas(list);*/
        }