diff --git a/Assets/ManagedResources/~Lua/Common/functions.lua b/Assets/ManagedResources/~Lua/Common/functions.lua index 16df3770df..1ab0a41da8 100644 --- a/Assets/ManagedResources/~Lua/Common/functions.lua +++ b/Assets/ManagedResources/~Lua/Common/functions.lua @@ -409,6 +409,10 @@ function GetStarOrGodSoulLv(index,data) return data.star,index end +function SetOriScale() + +end + --把英雄星级父对象和星级传过来 type 1 第6-11个预设 type 2 第12-17个预设 type 3 第18-24个预设 function SetHeroStars(spLoader, starGrid, star, type,_starSize,_scale,_pivot,rotation) local starSize @@ -434,16 +438,11 @@ function SetHeroStars(spLoader, starGrid, star, type,_starSize,_scale,_pivot,rot if _pivot then pivot = _pivot end - local isHave = false local starPre = Util.GetGameObject(starGrid, "starGrid(Clone)") - if starPre then - local starPre = Util.GetGameObject(starGrid, "starGrid(Clone)") - destroy(starPre) - starPre = nil - isHave = false + if not starPre then + starPre = poolManager:LoadAsset("starGrid", PoolManager.AssetType.GameObject) end - starPre = poolManager:LoadAsset("starGrid", PoolManager.AssetType.GameObject) - isHave = false + local size = starPre:GetComponent("RectTransform").sizeDelta size.y = starSize.y starPre.transform.sizeDelta = size @@ -460,14 +459,14 @@ function SetHeroStars(spLoader, starGrid, star, type,_starSize,_scale,_pivot,rot if i > 18 and i <= star + 18 then starPre.transform:GetChild(i - 1).gameObject:SetActive(true) --starPre.transform:GetChild(i - 1):GetComponent("RectTransform").sizeDelta = starSize - if not isHave then - local fx_shenhun = Util.GetGameObject(starPre.transform:GetChild(i - 1),"fx_shenhun") - if fx_shenhun then - Util.SetParticleScale(fx_shenhun,starSize.x) - local pos = fx_shenhun.transform.localPosition - pos.y = starSize.y - fx_shenhun.transform.localPosition = pos - end + local fx_shenhun = Util.GetGameObject(starPre.transform:GetChild(i - 1),"fx_shenhun") + if fx_shenhun then + local fixedScale = 1/ Util.GetGameObject(fx_shenhun,"zong/Particle System").transform.localScale.x + Util.SetParticleScale(fx_shenhun,fixedScale) + Util.SetParticleScale(fx_shenhun,starSize.x) + local pos = fx_shenhun.transform.localPosition + pos.y = starSize.y + fx_shenhun.transform.localPosition = pos end else starPre.transform:GetChild(i - 1).gameObject:SetActive(false)