技能生成特效
This commit is contained in:
parent
1e1d9cd913
commit
9479a931f6
@ -131,10 +131,12 @@ function BattleController:onLinkChange()
|
|||||||
cell:showHighLight(false)
|
cell:showHighLight(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local influenceMap = {}
|
||||||
for posId, info in pairs(self.battleData:getSkillInfluenceGrids()) do
|
for posId, info in pairs(self.battleData:getSkillInfluenceGrids()) do
|
||||||
local entity = self.battleData:getGridEntity(posId)
|
local entity = self.battleData:getGridEntity(posId)
|
||||||
if not posIdMap[posId] and info.direction ~= BattleConst.BOARD_RANGE_TYPE.RANDOM then
|
if not influenceMap[posId] and info.direction ~= BattleConst.BOARD_RANGE_TYPE.RANDOM then
|
||||||
posIdMap[posId] = true
|
posIdMap[posId] = true
|
||||||
|
influenceMap[posId] = true
|
||||||
if not entity:getSkillId() then
|
if not entity:getSkillId() then
|
||||||
local elementType = entity:getElementType()
|
local elementType = entity:getElementType()
|
||||||
elementTypeMap[elementType] = (elementTypeMap[elementType] or 0) + 1
|
elementTypeMap[elementType] = (elementTypeMap[elementType] or 0) + 1
|
||||||
|
|||||||
@ -58,6 +58,7 @@ function BattleUI:_display()
|
|||||||
self:initSkillSelectCells()
|
self:initSkillSelectCells()
|
||||||
self:hideAllSfxSmoke()
|
self:hideAllSfxSmoke()
|
||||||
self:initSkillLineSfx()
|
self:initSkillLineSfx()
|
||||||
|
self:initGenerateSkillEffect()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUI:_addListeners()
|
function BattleUI:_addListeners()
|
||||||
@ -790,9 +791,11 @@ function BattleUI:generateSkillAni(map, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.generateSkillAniSeq = self.root:createBindTweenSequence()
|
self.generateSkillAniSeq = self.root:createBindTweenSequence()
|
||||||
|
local count = 0
|
||||||
for elementType, info in pairs(map) do
|
for elementType, info in pairs(map) do
|
||||||
local entity = self.generateSkillGridEntities[elementType]
|
local entity = self.generateSkillGridEntities[elementType]
|
||||||
if entity and entity:getCell() then
|
if entity and entity:getCell() then
|
||||||
|
count = count + 1
|
||||||
entity:setSkilId(info.skillId)
|
entity:setSkilId(info.skillId)
|
||||||
local cell = entity:getCell()
|
local cell = entity:getCell()
|
||||||
cell:refresh(entity)
|
cell:refresh(entity)
|
||||||
@ -802,6 +805,13 @@ function BattleUI:generateSkillAni(map, callback)
|
|||||||
end)
|
end)
|
||||||
local pos = ModuleManager.BattleManager:getPosInfo(info.posId)
|
local pos = ModuleManager.BattleManager:getPosInfo(info.posId)
|
||||||
self.generateSkillAniSeq:Append(cell:getBaseObject():getTransform():DOAnchorPos(pos, 0.5))
|
self.generateSkillAniSeq:Append(cell:getBaseObject():getTransform():DOAnchorPos(pos, 0.5))
|
||||||
|
if self.generateSkillSfxs and self.generateSkillSfxs[count] then
|
||||||
|
self.generateSkillSfxs[count]:setAnchoredPosition(pos.x, pos.y)
|
||||||
|
self.generateSkillAniSeq:AppendCallback(function()
|
||||||
|
self.generateSkillSfxs[count]:setActive(true)
|
||||||
|
self.generateSkillSfxs[count]:play()
|
||||||
|
end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.generateSkillAniSeq:AppendCallback(function()
|
self.generateSkillAniSeq:AppendCallback(function()
|
||||||
@ -834,6 +844,24 @@ function BattleUI:hideGenerateSkillGridCells()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleUI:initGenerateSkillEffect()
|
||||||
|
if not self.generateSkillSfxs then
|
||||||
|
local uiMap = self.root:genAllChildren()
|
||||||
|
self.generateSkillSfxs = {}
|
||||||
|
self.generateSkillSfxs[1] = uiMap["battle_ui.bg_2.ani_node.sfx_piece_skill_b01_1"]
|
||||||
|
self.generateSkillSfxs[2] = uiMap["battle_ui.bg_2.ani_node.sfx_piece_skill_b01_2"]
|
||||||
|
self.generateSkillSfxs[3] = uiMap["battle_ui.bg_2.ani_node.sfx_piece_skill_b01_3"]
|
||||||
|
self.generateSkillSfxs[4] = uiMap["battle_ui.bg_2.ani_node.sfx_piece_skill_b01_4"]
|
||||||
|
self.generateSkillSfxs[5] = uiMap["battle_ui.bg_2.ani_node.sfx_piece_skill_b01_5"]
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, obj in pairs(self.generateSkillSfxs) do
|
||||||
|
obj:setActive(true)
|
||||||
|
obj:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_EFFECT_HELPER):SetSortingOrder(self:getUIOrder(), GConst.UI_EFFECT_ORDER.LEVEL1)
|
||||||
|
obj:setActive(false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function BattleUI:gotOneSkillAni(skillId, elementType, callback, startPos)
|
function BattleUI:gotOneSkillAni(skillId, elementType, callback, startPos)
|
||||||
if not skillId or not self.skillSelectCell then
|
if not skillId or not self.skillSelectCell then
|
||||||
if callback then
|
if callback then
|
||||||
@ -912,7 +940,7 @@ function BattleUI:fallGrid(listInfo, callback)
|
|||||||
cell.fallSeq = baseObject:createBindTweenSequence()
|
cell.fallSeq = baseObject:createBindTweenSequence()
|
||||||
baseObject:setAnchoredPosition(info[1].x, info[1].y)
|
baseObject:setAnchoredPosition(info[1].x, info[1].y)
|
||||||
local count = #info
|
local count = #info
|
||||||
cell.fallSeq:Append(baseObject:getTransform():DOLocalPath(info, GConst.BattleConst.ONE_STEP_TIME * count):SetEase(CS.DG.Tweening.Ease.OutCubic))
|
cell.fallSeq:Append(baseObject:getTransform():DOLocalPath(info, GConst.BattleConst.ONE_STEP_TIME * count):SetEase(CS.DG.Tweening.Ease.InOutQuint))
|
||||||
cell.fallSeq:AppendCallback(function()
|
cell.fallSeq:AppendCallback(function()
|
||||||
self.fallAniCount = self.fallAniCount - 1
|
self.fallAniCount = self.fallAniCount - 1
|
||||||
if self.fallAniCount == 0 then
|
if self.fallAniCount == 0 then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user