diff --git a/Assets/ManagedResources/~Lua/Modules/Hero/HeroSkinManager.lua b/Assets/ManagedResources/~Lua/Modules/Hero/HeroSkinManager.lua index 58cb0b2655..05c4483eb7 100644 --- a/Assets/ManagedResources/~Lua/Modules/Hero/HeroSkinManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Hero/HeroSkinManager.lua @@ -57,11 +57,9 @@ end function this.RemoveSkin(id) this.skinDatas[id] = nil - LogGreen("id:"..id.." IsExist:"..tostring(this.skinDatas[id])) end function this.IsExist(id) - LogGreen("id:"..id.." IsExist:"..tostring(this.skinDatas[id])) if this.skinDatas[id] then return true else @@ -70,7 +68,6 @@ function this.IsExist(id) end function this.GetSkins(id) - LogGreen("id:"..id.." IsExist:"..tostring(this.skinDatas[id])) if this.skinDatas[id] then return this.skinDatas[id] else diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoLayout.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoLayout.lua index b844cce2a6..902a23fdf6 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoLayout.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleInfoLayout.lua @@ -181,7 +181,7 @@ function this:ProShow(go,allAddProVal,HeroProType,nextallAddProVal) local curProSConFig = ConfigManager.GetConfigData(ConfigName.PropertyConfig,HeroProType) Util.GetGameObject(go,"proName"):GetComponent("Text").text = curProSConFig.Info..":" Util.GetGameObject(go,"proValue"):GetComponent("Text").text = allAddProVal[HeroProType] - Util.GetGameObject(go,"Image"):GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(propertyConfig[HeroProType].PropertyIcon)) + Util.GetGameObject(go,"Image"):GetComponent("Image").sprite = Util.LoadSprite(PropertyTypeIconDef[HeroProType]) if nextallAddProVal then Util.GetGameObject(go,"nextproValue"):GetComponent("Text").text = nextallAddProVal[HeroProType] end diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleSkinPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleSkinPanel.lua index a482564caa..b258e4a176 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleSkinPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleSkinPanel.lua @@ -6,7 +6,7 @@ local artResConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig) local skinPres = {} local porpertys = {} local curHeroData = {} -local skins = {} + local parent = {} local curLiveName = "" local isUnLoadLive = false @@ -42,18 +42,30 @@ function RoleSkinPanel:OnShow(_sortinglayer,_parent,_curHerodata) curHeroData = _curHerodata parent = _parent local configs = ConfigManager.GetAllConfigsDataByKey(ConfigName.HeroSkin,"HeroId",curHeroData.id) - local skins = {} + local tempskins = {} for i = 1 ,#configs do - if not skins[configs[i].Type] then - skins[configs[i].Type] = configs[i] + LogGreen("configs[i].Type:"..configs[i].Type) + if not tempskins[configs[i].Type] then + tempskins[configs[i].Type] = configs[i] end end + local skins = {} + for i,v in pairs(tempskins) do + table.insert(skins,v) + end + table.sort(skins,function(a,b) + if a.Type == b.Type then + return a.Id < b.Id + else + return a.Type < b.Type + end + end) for k,v in pairs(skinPres) do v.obj.gameObject:SetActive(false) v.data = nil end local index = 1 - for i,v in pairs(skins) do + for i,v in ipairs(skins) do if not skinPres[index] then skinPres[index] = {} end @@ -61,6 +73,7 @@ function RoleSkinPanel:OnShow(_sortinglayer,_parent,_curHerodata) skinPres[index].obj = newObjToParent(this.skinPre,this.skinGrid) end skinPres[index].data = v + LogGreen("v.Type:"..v.Type) skinPres[index].obj.gameObject:SetActive(true) self:SetSingleData(skinPres[index].obj,v) index = index + 1