【挂机】修复伤害数字不消失

dev_chengFeng
gaoxin 2021-06-03 19:10:41 +08:00
parent 5d9224bc72
commit fb6338de41
1 changed files with 20 additions and 18 deletions

View File

@ -707,27 +707,28 @@ end
-- 怪物被打得吐血
--- @param showType 参数为0时表示为掉血参数大于0时表示为补血
function SingleFightPlayerView:private_BloodBlood(objPos, index, iconType, isMonster, showType, func)
local go = self.hurtNum[math.floor(index % 3 + 1)]
local i = math.floor(index % 3 + 1)
-- 吐血随机值
local hurtNum, isCritical = iconAction.pravite_GetHurtValue(isMonster, iconType, showType)
local v2 = SetObjPosByUV(objPos)
go:GetComponent("RectTransform").anchoredPosition3D = Vector3.New(v2.x, v2.y, 0) + Vector3.New(0, 120, 0)
Util.GetGameObject(go, "anim/Image"):SetActive(false)
Util.GetGameObject(go, "anim/anim"):GetComponent("Text").text = iconAction.DecodeHurt(hurtNum, isCritical, showType)
go:SetActive(true)
self.hurtNum[i]:GetComponent("RectTransform").anchoredPosition3D = Vector3.New(v2.x, v2.y, 0) + Vector3.New(0, 120, 0)
Util.GetGameObject(self.hurtNum[i], "anim/Image"):SetActive(false)
Util.GetGameObject(self.hurtNum[i], "anim/anim"):GetComponent("Text").text = iconAction.DecodeHurt(hurtNum, isCritical, showType)
self.hurtNum[i]:SetActive(true)
if self.hurtNumTimer then
self.hurtNumTimer:Stop()
self.hurtNumTimer = nil
end
self.hurtNumTimer = Timer.New(function()
if go then
go:SetActive(false)
-- if self.hurtNumTimer then
-- self.hurtNumTimer:Stop()
-- self.hurtNumTimer = nil
-- end
-- self.hurtNumTimer =
Timer.New(function()
if self.hurtNum[i] then
self.hurtNum[i]:SetActive(false)
end
if func then func() end
end, 1.5)
self.hurtNumTimer:Start()
end, 1.5):Start()
-- self.hurtNumTimer
end
-- 震动动画
@ -823,10 +824,10 @@ function SingleFightPlayerView:StopAction()
self.callbackTimer:Stop()
self.callbackTimer = nil
end
if self.hurtNumTimer then
self.hurtNumTimer:Stop()
self.hurtNumTimer = nil
end
-- if self.hurtNumTimer then
-- self.hurtNumTimer:Stop()
-- self.hurtNumTimer = nil
-- end
if self.battleTimer then
self.battleTimer:Stop()
self.battleTimer = nil
@ -843,6 +844,7 @@ function SingleFightPlayerView:OnClose()
self.isclose = true
self.dialogueRoot.gameObject:SetActive(false)
self:StopAction()
self.hurtNum = {}
self.buffTipList = {}
if self.playerLiveView then
self.playerLiveView:OnClose()