【新将来袭】宝箱位置调整

dev_chengFeng
ZhangBiao 2020-12-04 19:42:47 +08:00
parent 2c2e208bc1
commit 1fcb892050
1 changed files with 6 additions and 3 deletions

View File

@ -50,7 +50,7 @@ function this:InitComponent()
this.damageText = Util.GetGameObject(this.damagePanel, "progress/Text"):GetComponent("Text")
this.dmg2 = Util.GetGameObject(this.UpRoot, "dmg2")--新将来袭的血条
for i = 1, 5 do
for i = 1, 7 do
boxList[i] = Util.GetGameObject(this.dmg2, "box"..i)
boxList[i]:SetActive(false)
local effect = Util.GetGameObject(boxList[i], "effect")
@ -621,9 +621,12 @@ function this.RefreshMyDamageShow(data)
for i = 1, #boxs do
if curPercent >= (boxs[i][1]/boxs[#boxs][1])*100 then
boxList[i+1]:SetActive(true)
if boxList[i+1] then
boxList[i+1]:SetActive(true)
end
boxList[i].transform:SetParent(this.bar.transform)
boxList[i].transform:DOLocalMove(Vector3.New(0,-329+(i-1)*118,0), 1.5)
local t = i%5 == 0 and 5 or i%5
boxList[i].transform:DOLocalMove(Vector3.New(math.floor(i/6)*-120,-329+t*100,0), 1.5)
Util.GetGameObject(boxList[i], "effect"):SetActive(true)
end
end