水泡动画
This commit is contained in:
parent
5a9558184b
commit
14f51d2900
@ -34,6 +34,18 @@ function EffectObject:play()
|
|||||||
self.effectHelper:Play()
|
self.effectHelper:Play()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function EffectObject:playComplete(complete, customTime)
|
||||||
|
self.effectHelper:Play()
|
||||||
|
local duration = customTime or self:getDuration()
|
||||||
|
if self.playCompleteSeq then
|
||||||
|
self.playCompleteSeq:Kill()
|
||||||
|
self.playCompleteSeq = nil
|
||||||
|
end
|
||||||
|
self.playCompleteSeq = self:createBindTweenSequence()
|
||||||
|
self.playCompleteSeq:AppendInterval(duration)
|
||||||
|
self.playCompleteSeq:AppendCallback(complete)
|
||||||
|
end
|
||||||
|
|
||||||
-- 延迟播放
|
-- 延迟播放
|
||||||
function EffectObject:playDelay(delayTime, hideBeforePlay)
|
function EffectObject:playDelay(delayTime, hideBeforePlay)
|
||||||
if delayTime <= 0 then
|
if delayTime <= 0 then
|
||||||
|
|||||||
@ -30,7 +30,13 @@ local function _crossSpread(entity, gridEntities, battleController, onlyCheck)
|
|||||||
for _, posId in ipairs(tempList) do
|
for _, posId in ipairs(tempList) do
|
||||||
local gridEntity = gridEntities[posId]
|
local gridEntity = gridEntities[posId]
|
||||||
if gridEntity:isEmptyIdle() then
|
if gridEntity:isEmptyIdle() then
|
||||||
|
if battleController.battleUI and entity:getEffectSfx() then
|
||||||
|
battleController.battleUI:showGridEffectSfx(posId, entity:getEffectSfx(), function()
|
||||||
battleController.battleData:setGridType(posId, entity:getGridType() or BattleConst.GRID_TYPE.JELLY)
|
battleController.battleData:setGridType(posId, entity:getGridType() or BattleConst.GRID_TYPE.JELLY)
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
battleController.battleData:setGridType(posId, entity:getGridType() or BattleConst.GRID_TYPE.JELLY)
|
||||||
|
end
|
||||||
succ = true
|
succ = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1082,6 +1082,22 @@ function BattleUI:dealGridEffectSfx(time, info, breakSfxNameIndexMap, entity)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleUI:showGridEffectSfx(posId, sfxName, callback)
|
||||||
|
self:getSfxGridEffect(sfxName, function(info)
|
||||||
|
info.isIdle = false
|
||||||
|
local pos = ModuleManager.BattleManager:getPosInfo(posId)
|
||||||
|
info.obj:setLocalPosition(pos.x, pos.y, 0)
|
||||||
|
info.obj:setActive(true)
|
||||||
|
info.obj:playComplete(function()
|
||||||
|
info.isIdle = true
|
||||||
|
info.obj:setActive(false)
|
||||||
|
if callback then
|
||||||
|
callback()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
function BattleUI:generateSkillAni(map, callback)
|
function BattleUI:generateSkillAni(map, callback)
|
||||||
if table.nums(map) <= 0 then
|
if table.nums(map) <= 0 then
|
||||||
if callback then
|
if callback then
|
||||||
@ -1698,6 +1714,39 @@ function BattleUI:resetParentAllSfxGridBreak()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleUI:getSfxGridEffect(effectSfxPath, func)
|
||||||
|
if not effectSfxPath then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if not self.root.gridEffectSfx then
|
||||||
|
self.root.gridEffectSfx = {}
|
||||||
|
end
|
||||||
|
if not self.root.gridEffectSfx[effectSfxPath] then
|
||||||
|
self.root.gridEffectSfx[effectSfxPath] = {}
|
||||||
|
end
|
||||||
|
local count = 0
|
||||||
|
for index, info in pairs(self.root.gridEffectSfx[effectSfxPath]) do
|
||||||
|
if info.isIdle then
|
||||||
|
func(self.root.gridEffectSfx[effectSfxPath][index])
|
||||||
|
return
|
||||||
|
end
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
local index = count + 1
|
||||||
|
self.root.gridEffectSfx[effectSfxPath][index] = {
|
||||||
|
isLoaded = true,
|
||||||
|
}
|
||||||
|
EffectManager:loadUIEffectAsync(effectSfxPath, self, self.gridNode, GConst.UI_EFFECT_ORDER.LEVEL5, function(obj)
|
||||||
|
self.root.gridEffectSfx[effectSfxPath][index].obj = obj
|
||||||
|
self.root.gridEffectSfx[effectSfxPath][index].isIdle = true
|
||||||
|
if func then
|
||||||
|
func(self.root.gridEffectSfx[effectSfxPath][index])
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
function BattleUI:getSfxSmoke(index, func)
|
function BattleUI:getSfxSmoke(index, func)
|
||||||
self.hidingAllSfxSmoke = false
|
self.hidingAllSfxSmoke = false
|
||||||
|
|
||||||
@ -1900,6 +1949,18 @@ function BattleUI:initUISfxs()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.root.gridEffectSfx then
|
||||||
|
for breakSfxPath, list in pairs(self.root.gridEffectSfx) do
|
||||||
|
for index, info in pairs(list) do
|
||||||
|
if info.obj then
|
||||||
|
info.obj:setActive(true)
|
||||||
|
info.obj:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_EFFECT_HELPER):SetSortingOrder(self:getUIOrder(), GConst.UI_EFFECT_ORDER.LEVEL5)
|
||||||
|
info.obj:setActive(false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if self.root.lineSfxObjs then
|
if self.root.lineSfxObjs then
|
||||||
for index, info in pairs(self.root.lineSfxObjs) do
|
for index, info in pairs(self.root.lineSfxObjs) do
|
||||||
if info.obj then
|
if info.obj then
|
||||||
@ -2256,6 +2317,11 @@ function BattleUI:clear()
|
|||||||
self.bossEnterAniSeq:Kill()
|
self.bossEnterAniSeq:Kill()
|
||||||
self.bossEnterAniSeq = nil
|
self.bossEnterAniSeq = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.showGridEffectSfxSid then
|
||||||
|
self:unscheduleGlobal(self.showGridEffectSfxSid)
|
||||||
|
self.showGridEffectSfxSid = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return BattleUI
|
return BattleUI
|
||||||
Loading…
x
Reference in New Issue
Block a user