【灵兽系统】 星级居中修改
parent
8b22166237
commit
8070a4fa47
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -64,7 +64,7 @@ function this.GetShowPanelData()
|
|||
this.heroName.text = pokemonSData.Name
|
||||
this.ShowPokemonLive(pokemonSData)
|
||||
--星级
|
||||
SetHeroStars(this.starGrid, pokemonBackData.star,2,Vector2.New(60,60),-11.92,Vector2.New(0.5,0.5))
|
||||
PokemonManager.SetHeroStars(this.starGrid, pokemonBackData.star,2,Vector2.New(60,60))
|
||||
--属性
|
||||
local allAddProVal=PokemonManager.GetSinglePokemonAddProDataByLvAndStar(pokemonBackData.id,pokemonBackData.level,pokemonBackData.star)
|
||||
proList[0]:SetActive(true)
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ function this.UpdateHeroInfoData()
|
|||
this.dragView.gameObject:SetActive(false)
|
||||
end
|
||||
local starSize = Vector2.New(65,65)
|
||||
SetHeroStars(this.starGrid, curPokemonData.star,1,starSize,0,Vector2.New(0.5,0.5))
|
||||
PokemonManager.SetHeroStars(this.starGrid, curPokemonData.star,1,starSize)
|
||||
--SetHeroStars(starGrid, heroData.star,1,nil,nil,Vector2.New(0,1))
|
||||
--常规属性赋值
|
||||
upZhenDidis = PokemonManager.GetAllPokemonFormationDids()
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ function this.ShowSinglePokemonList(go,singleData,liveIndex)
|
|||
local live2d = poolManager:LoadLive(LiveName, curPokemonLive.transform,Vector3.one *curData.scale * 0.4, Vector3.New(spiritAnimal[curData.id].littleScalePosition[1],spiritAnimal[curData.id].littleScalePosition[2],0))--curData.scale
|
||||
live2dList[liveIndex] = {name=curData.live, go=live2d}
|
||||
local starSize = Vector2.New(65,65)
|
||||
SetHeroStars(Util.GetGameObject(go, "upZhenInfo/starGrid"), curData.star,1,starSize,0,Vector2.New(0.5,0.5))
|
||||
PokemonManager.SetHeroStars(Util.GetGameObject(go, "upZhenInfo/starGrid/starGrid(Clone)"), curData.star,1,starSize)
|
||||
-- Util.AddOnceClick( Util.GetGameObject(go, "upZhenInfo/upZhenClick"), function()
|
||||
-- UIManager.OpenPanel(UIName.PokemonInfoPanel,curData,PokemonManager.GetPokemonDatas())
|
||||
-- end)
|
||||
|
|
|
|||
|
|
@ -618,4 +618,55 @@ function this.PokemonChipCompoundRedPoint()
|
|||
end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
function this.SetHeroStars(starPre,star,type,starSize)
|
||||
if star < 6 then
|
||||
for i = 1, 17 do
|
||||
if i <= star then
|
||||
starPre.transform:GetChild(i - 1):GetComponent("Image").sprite = Util.LoadSprite(GetHeroStarImage[1])
|
||||
starPre.transform:GetChild(i - 1):GetComponent("RectTransform").sizeDelta = starSize
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(true)
|
||||
else
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
elseif star > 5 and star < 10 then
|
||||
for i = 1, 17 do
|
||||
if i <= star - 5 then
|
||||
starPre.transform:GetChild(i - 1):GetComponent("Image").sprite = Util.LoadSprite(GetHeroStarImage[2])
|
||||
starPre.transform:GetChild(i - 1):GetComponent("RectTransform").sizeDelta = starSize
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(true)
|
||||
else
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
elseif star > 9 then
|
||||
if type and type == 1 then
|
||||
for i = 1, 17 do
|
||||
if i == star - 4 then
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(true)
|
||||
else
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
elseif type and type == 2 then
|
||||
for i = 1, 17 do
|
||||
if i > 11 and i == star + 2 then
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(true)
|
||||
else
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
else
|
||||
for i = 1, 17 do
|
||||
if i == star - 4 then
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(true)
|
||||
else
|
||||
starPre.transform:GetChild(i - 1).gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return this
|
||||
Loading…
Reference in New Issue