格子支持一下spine
This commit is contained in:
parent
ededa19132
commit
694ef22777
@ -29,8 +29,27 @@ function GridCell:refresh(gridEntity, curElement, skillPosId)
|
|||||||
|
|
||||||
if self.lastGridType ~= gridEntity:getGridType() then
|
if self.lastGridType ~= gridEntity:getGridType() then
|
||||||
self.lastGridType = gridEntity:getGridType()
|
self.lastGridType = gridEntity:getGridType()
|
||||||
local atlas, icon = gridEntity:getIcon()
|
local spineObj = uiMap["grid_cell.touch_node.ani_node.up_bg.ui_spine_obj"]
|
||||||
uiMap["grid_cell.touch_node.ani_node.up_bg"]:setSprite(atlas, icon)
|
local upBg = uiMap["grid_cell.touch_node.ani_node.up_bg"]
|
||||||
|
if gridEntity:getSpineAsset() then
|
||||||
|
spineObj:setActive(true)
|
||||||
|
Logger.logHighlight(gridEntity:getSpineIdleName())
|
||||||
|
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
|
||||||
|
Logger.logHighlight("----")
|
||||||
|
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()
|
||||||
|
upBg:setSprite(atlas, icon)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local skillIcon = uiMap["grid_cell.touch_node.ani_node.skill_icon"]
|
local skillIcon = uiMap["grid_cell.touch_node.ani_node.skill_icon"]
|
||||||
|
|||||||
@ -394,4 +394,16 @@ function BattleGridEntity:getBreakFlyToCharacterIcon()
|
|||||||
return self:getGridTypeConfig().bftc_icon
|
return self:getGridTypeConfig().bftc_icon
|
||||||
end
|
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
|
return BattleGridEntity
|
||||||
Loading…
x
Reference in New Issue
Block a user