神魂星星修改提交

dev_chengFeng
jiaoyangna 2021-11-04 15:47:49 +08:00
parent de71cd524b
commit 028790a379
1 changed files with 15 additions and 16 deletions

View File

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