local UIResonanceLevelUp = UIViewClass() --------------------------- 系统函数 ----------------------------- function UIResonanceLevelUp:OnOpened(context) -- 重置当前升级的子共鸣类型 MDL.FormationResonance.ResetLastUpdateSubType() if not context or not context.level or not context.subType then return end local level = context.level local subTypeId = context.subType local cfg = MDL.FormationResonance.GetSubResonanceCfg(subTypeId) local curInfoCfg = MDL.FormationResonance.GetSubResonanceInfoCfg(subTypeId, level) local lastInfoCfg = MDL.FormationResonance.GetSubResonanceInfoCfg(subTypeId, level - 1) UIUtils.SetImageByAssetBundle(self.icon_Resonance, cfg.Icon) UIUtils.SetLabel(self.txt_ResonanceLv, string.FormatByIdsId(Const_IDS["IDS_Resonance_Level"], level)) UIUtils.SetLabelText(self.txt_Name, Const_IDS[cfg.ResonanceChildName]) for i = 1, 3 do local attrData = curInfoCfg.Attr_Table[i] local lastAttrData = lastInfoCfg and lastInfoCfg.Attr_Table[i] or nil local attrUI = self.group_Attr[i] UIUtils.SetActive(attrUI.gameObject, attrData ~= nil) if attrData then local attrCfg = DataSheetManager.AttrData:GetDataByID(attrData.AttrType) if attrCfg then UIUtils.SetLabelText(attrUI.lab_Attr, Const_IDS[attrCfg.Name]) UIUtils.SetLabel(attrUI.txt_AttrOld, lastInfoCfg and lastAttrData.AttrNum or 0) UIUtils.SetLabel(attrUI.txt_AttrNew, attrData.AttrNum) end end end local uiScore = self.group_Integral01 UIUtils.SetLabel(uiScore.txt_IntegralOld, lastInfoCfg and lastInfoCfg.Score or 0) UIUtils.SetLabel(uiScore.txt_IntegralNew, curInfoCfg.Score) self.effect:PlayUIEffect() end function UIResonanceLevelUp:OnButtonClicked(comp) if comp == self.group_Notice then self:CloseView() end end ------------------------------------------------------------------- return UIResonanceLevelUp