Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev
This commit is contained in:
commit
dfd19f71f4
@ -95,8 +95,8 @@ function UISpineObject:rePlayAnim(animName, loop, forceRefresh)
|
||||
end
|
||||
end
|
||||
|
||||
function UISpineObject:playAnimComplete(animName, loop, forceRefresh, complete)
|
||||
local spineAnim = self:getAnimation(self:playAnim(animName, loop, forceRefresh))
|
||||
function UISpineObject:playAnimComplete(animName, loop, forceRefresh, complete, forceGetSG)
|
||||
local spineAnim = self:getAnimation(self:playAnim(animName, loop, forceRefresh, forceGetSG))
|
||||
local duration = spineAnim.Duration
|
||||
local sequence = self:createBindTweenSequence()
|
||||
sequence:AppendInterval(duration)
|
||||
|
||||
@ -29,8 +29,25 @@ function GridCell:refresh(gridEntity, curElement, skillPosId)
|
||||
|
||||
if self.lastGridType ~= gridEntity:getGridType() then
|
||||
self.lastGridType = gridEntity:getGridType()
|
||||
local spineObj = uiMap["grid_cell.touch_node.ani_node.up_bg.ui_spine_obj"]
|
||||
local upBg = uiMap["grid_cell.touch_node.ani_node.up_bg"]
|
||||
if gridEntity:getSpineAsset() then
|
||||
spineObj:setActive(true)
|
||||
spineObj:loadAssetAsync(gridEntity:getSpineAsset(), function()
|
||||
if gridEntity:getSpineChangeName() then
|
||||
spineObj:playAnimComplete(gridEntity:getSpineChangeName(), false, true, function()
|
||||
spineObj:playAnim(gridEntity:getSpineIdleName(), true, false, true)
|
||||
end, true)
|
||||
else
|
||||
spineObj:playAnim(gridEntity:getSpineIdleName(), true, false, true)
|
||||
end
|
||||
end)
|
||||
upBg:setSprite(GConst.ATLAS_PATH.COMMON, "common_alpha")
|
||||
else
|
||||
spineObj:setActive(false)
|
||||
local atlas, icon = gridEntity:getIcon()
|
||||
uiMap["grid_cell.touch_node.ani_node.up_bg"]:setSprite(atlas, icon)
|
||||
upBg:setSprite(atlas, icon)
|
||||
end
|
||||
end
|
||||
|
||||
local skillIcon = uiMap["grid_cell.touch_node.ani_node.skill_icon"]
|
||||
@ -219,6 +236,7 @@ end
|
||||
function GridCell:setGridTypeIcon(icon)
|
||||
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.ui_spine_obj"]:setActive(false)
|
||||
end
|
||||
|
||||
return GridCell
|
||||
@ -394,4 +394,16 @@ function BattleGridEntity:getBreakFlyToCharacterIcon()
|
||||
return self:getGridTypeConfig().bftc_icon
|
||||
end
|
||||
|
||||
function BattleGridEntity:getSpineAsset()
|
||||
return self:getGridTypeConfig().spine_name
|
||||
end
|
||||
|
||||
function BattleGridEntity:getSpineIdleName()
|
||||
return self:getGridTypeConfig().spine_idle
|
||||
end
|
||||
|
||||
function BattleGridEntity:getSpineChangeName()
|
||||
return self:getGridTypeConfig().spine_change
|
||||
end
|
||||
|
||||
return BattleGridEntity
|
||||
Loading…
x
Reference in New Issue
Block a user