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(); }
public void Fill(Hotfix_LT.Combat.CombatCharacterSyncData.SkillData skillData, bool isSelect = false, bool onlyFill = false) { this.Data = skillData; Icon.spriteName = skillData.Icon; LTUIUtil.SetText(NameLabel, skillData.TypeName); SkillSetTool.SkillFrameStateSet(FrameSprite, Hotfix_LT.Data.CharacterTemplateManager.Instance.IsAwakenSkill(skillData.ID)); if (skillData.SkillType == (int)Hotfix_LT.Data.eSkillType.ACTIVE) { CDMaskSprite.fillAmount = (float)skillData.CD / skillData.MaxCooldown; CDMaskSprite.gameObject.SetActive(true); if (skillData.CD > 0) { Icon.color = new Color(255 / 255f, 0, 255 / 255f, 1); LTUIUtil.SetText(CDTurnLabel, skillData.CD.ToString()); } else { Icon.color = Color.white; LTUIUtil.SetText(CDTurnLabel, ""); } } else { if (skillData.CD > 0) { Debug.LogError("Not SpecialSkill But skillCD>0"); } LTUIUtil.SetText(CDTurnLabel, ""); CDMaskSprite.gameObject.SetActive(false); Icon.color = Color.white; } if (!onlyFill) { if (skillData.SkillType == (int)Hotfix_LT.Data.eSkillType.PASSIVE) { PassiveFX.gameObject.SetActive(true); } else { PassiveFX.gameObject.SetActive(false); } SelectedObj.gameObject.SetActive(isSelect); } mDMono.gameObject.CustomSetActive(true); }
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);*/ }
/// <summary> /// 技能图标 /// </summary> /// <param name="commonSkill"></param> /// <param name="commonSkillLevel"></param> /// <param name="activeSkill"></param> /// <param name="activeSkillLevel"></param> /// <param name="passiveSkill"></param> /// <param name="passiveSkillLevel"></param> /// <param name="infoId">用于读取觉醒技能替换信息</param> /// <param name="awakenLevel">是否觉醒</param>> private void SetSkillInfo(int commonSkill, int commonSkillLevel, int activeSkill, int activeSkillLevel, int passiveSkill, int passiveSkillLevel, int infoId, int awakenLevel) { SkillSetTool.SkillFrameStateSet(CommonFrame, false); SkillSetTool.SkillFrameStateSet(PassiveFrame, false); SkillSetTool.SkillFrameStateSet(ActiveFrame, false); if (awakenLevel > 0) { Hotfix_LT.Data.HeroAwakeInfoTemplate template = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroAwakeInfoByInfoID(infoId); if (template.beforeSkill == commonSkill) { commonSkill = template.laterSkill; SkillSetTool.SkillFrameStateSet(CommonFrame, true); } if (template.beforeSkill == activeSkill) { activeSkill = template.laterSkill; SkillSetTool.SkillFrameStateSet(ActiveFrame, true); } if (template.beforeSkill == passiveSkill) { passiveSkill = template.laterSkill; SkillSetTool.SkillFrameStateSet(PassiveFrame, true); } } commonSkillId = commonSkill; activateSkillId = activeSkill; passiveSkillId = passiveSkill; Hotfix_LT.Data.SkillTemplate commonSkillTem = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(commonSkill); if (commonSkillTem != null) { CommonSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(true); CommonSkillBreakSprite.spriteName = commonSkillTem.Icon; CommonSkillBreakNameLabel.text = commonSkillTem.Name; CommonSkillLevel.text = commonSkillLevel.ToString(); } else { CommonSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(false); } Hotfix_LT.Data.SkillTemplate passiveSkillTem = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(passiveSkill); if (passiveSkillTem != null) { PassiveSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(true); PassiveSkillBreakSprite.spriteName = passiveSkillTem.Icon; PassiveSkillBreakNameLabel.text = passiveSkillTem.Name; PassiveSkillLevel.text = passiveSkillLevel.ToString(); } else { PassiveSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(false); } Hotfix_LT.Data.SkillTemplate activeSkillTem = Hotfix_LT.Data.SkillTemplateManager.Instance.GetTemplate(activeSkill); if (activeSkillTem != null) { ActiveSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(true); ActiveSkillBreakSprite.spriteName = activeSkillTem.Icon; ActiveSkillBreakNameLabel.text = activeSkillTem.Name; ActiveSkillLevel.text = activeSkillLevel.ToString(); } else { ActiveSkillBreakNameLabel.transform.parent.gameObject.CustomSetActive(false); } }
public void UpdateUI() { GetSkillData(); if (m_SkillData == null) { return; } m_Icon.spriteName = m_SkillData.Icon; m_SkillName.text = m_SkillData.Name; m_SkillLevel.text = skillLevel.ToString(); //觉醒框显示,利用觉醒技能list查找 SkillSetTool.SkillFrameStateSet(m_SkillFrame, Hotfix_LT.Data.CharacterTemplateManager.Instance.IsAwakenSkill(m_SkillData.ID)); SetSkillType(m_SkillData.Type); SetSkillTargetLabel(m_SkillData.SelectTargetType); string cooldownStr = (m_SkillData.MaxCooldown > 0) ? (m_SkillData.MaxCooldown + EB.Localizer.GetString("ID_uifont_in_CombatHudV4_TurnFont_4")) : EB.Localizer.GetString("ID_SKILL_COOLDOWN_NOT"); SkillCooldownLabel.text = string.Format("{0}{1}", EB.Localizer.GetString("ID_SKILL_COOLDOWN"), cooldownStr); m_Context.text = GetContext(); m_ContextAdditional.text = LTPartnerSkillBreakController.GetSkillAdditional(m_SkillData.ID, skillLevel); int buffHeight = 0; if (m_SkillData.BuffDescribleID != null) { BuffTipObj.CustomSetActive(true); if (BuffTempList == null) { BuffTempList = new List <UISkillBuffTemplate>(); } for (int i = 0; i < BuffTempList.Count; i++) { BuffTempList[i].Hide(); } BuffDropObj.CustomSetActive(m_SkillData.BuffDescribleID.Count >= 3); for (int i = 0; i < m_SkillData.BuffDescribleID.Count; i++) { var buff = Hotfix_LT.Data.BuffTemplateManager.Instance.GetTemplate(m_SkillData.BuffDescribleID[i]); if (buff != null) { if (i >= BuffTempList.Count) { //新建buffTemp UISkillBuffTemplate temp = Object.Instantiate(BuffTemp.mDMono, Vector3.zero, Quaternion.Euler(0, 0, 0), BuffParentTable.transform).transform.GetMonoILRComponent <UISkillBuffTemplate>(); temp.SetData(buff); BuffTempList.Add(temp); } else { //复用buffTemp BuffTempList[i].SetData(buff); } if (m_SkillData.BuffDescribleID.Count >= 3) { buffHeight = 525; } else { buffHeight += BuffTempList[i].GetBuffTempHeight() + 15; } } } BuffParentTable.Reposition(); BuffScrollView.verticalScrollBar.value = 0; } else { BuffTipObj.CustomSetActive(false); } StartCoroutine(UpdatePos(buffHeight)); }