修复bug

This commit is contained in:
xiekaidong 2023-05-31 20:18:22 +08:00
parent 694ef22777
commit 3259281fe8
2 changed files with 3 additions and 4 deletions

View File

@ -95,8 +95,8 @@ function UISpineObject:rePlayAnim(animName, loop, forceRefresh)
end end
end end
function UISpineObject:playAnimComplete(animName, loop, forceRefresh, complete) function UISpineObject:playAnimComplete(animName, loop, forceRefresh, complete, forceGetSG)
local spineAnim = self:getAnimation(self:playAnim(animName, loop, forceRefresh)) local spineAnim = self:getAnimation(self:playAnim(animName, loop, forceRefresh, forceGetSG))
local duration = spineAnim.Duration local duration = spineAnim.Duration
local sequence = self:createBindTweenSequence() local sequence = self:createBindTweenSequence()
sequence:AppendInterval(duration) sequence:AppendInterval(duration)

View File

@ -33,14 +33,12 @@ function GridCell:refresh(gridEntity, curElement, skillPosId)
local upBg = uiMap["grid_cell.touch_node.ani_node.up_bg"] local upBg = uiMap["grid_cell.touch_node.ani_node.up_bg"]
if gridEntity:getSpineAsset() then if gridEntity:getSpineAsset() then
spineObj:setActive(true) spineObj:setActive(true)
Logger.logHighlight(gridEntity:getSpineIdleName())
spineObj:loadAssetAsync(gridEntity:getSpineAsset(), function() spineObj:loadAssetAsync(gridEntity:getSpineAsset(), function()
if gridEntity:getSpineChangeName() then if gridEntity:getSpineChangeName() then
spineObj:playAnimComplete(gridEntity:getSpineChangeName(), false, true, function() spineObj:playAnimComplete(gridEntity:getSpineChangeName(), false, true, function()
spineObj:playAnim(gridEntity:getSpineIdleName(), true, false, true) spineObj:playAnim(gridEntity:getSpineIdleName(), true, false, true)
end, true) end, true)
else else
Logger.logHighlight("----")
spineObj:playAnim(gridEntity:getSpineIdleName(), true, false, true) spineObj:playAnim(gridEntity:getSpineIdleName(), true, false, true)
end end
end) end)
@ -238,6 +236,7 @@ end
function GridCell:setGridTypeIcon(icon) function GridCell:setGridTypeIcon(icon)
local uiMap = self:getUIMap() local uiMap = self:getUIMap()
uiMap["grid_cell.touch_node.ani_node.up_bg"]:setSprite(GConst.ATLAS_PATH.BATTLE, icon) uiMap["grid_cell.touch_node.ani_node.up_bg"]:setSprite(GConst.ATLAS_PATH.BATTLE, icon)
uiMap["grid_cell.touch_node.ani_node.up_bg.ui_spine_obj"]:setActive(false)
end end
return GridCell return GridCell