【升级】长按升到最大级了,会无法触发抬起事件,导致升级失败

dev_chengFeng
gaoxin 2022-01-19 15:22:11 +08:00
parent 60df01190d
commit 35648e8762
1 changed files with 5 additions and 1 deletions

View File

@ -667,6 +667,10 @@ function this:UpdateHeroUpLvAndBreakMaterialShow()
if curHeroData.lv>=HeroManager.heroLvEnd[curHeroData.heroConfig.Id] then if curHeroData.lv>=HeroManager.heroLvEnd[curHeroData.heroConfig.Id] then
this.noUpLvText:SetActive(true) this.noUpLvText:SetActive(true)
this.upLv:SetActive(false) this.upLv:SetActive(false)
-- 长按升到最大级了,会无法触发抬起事件,主动调用一下
if _isLongPress then
this._onPointerUp()
end
else else
this.noUpLvText:SetActive(false) this.noUpLvText:SetActive(false)
this.upLv:SetActive(true) this.upLv:SetActive(true)
@ -939,7 +943,7 @@ function this.OnUpdate()
if timer <= 0 then if timer <= 0 then
timer = timer + 0.1 timer = timer + 0.1
_isLongPress = true _isLongPress = true
this:LvUpClick(false) this:LvUpClick(false)
end end
if Time.frameCount - oldFrame > 0 then if Time.frameCount - oldFrame > 0 then
oldFrame = Time.frameCount oldFrame = Time.frameCount