fix bug
This commit is contained in:
parent
8309062814
commit
3c7c289c79
@ -1013,8 +1013,7 @@ BattleConst.SKILL_LIGHT_POINT_SFX = "assets/prefabs/effects/battle/sfx_skill_b05
|
|||||||
BattleConst.SKILL_LIGHT_LINE_SFX = "assets/prefabs/effects/battle/sfx_skill_b04.prefab"
|
BattleConst.SKILL_LIGHT_LINE_SFX = "assets/prefabs/effects/battle/sfx_skill_b04.prefab"
|
||||||
BattleConst.LINE_SFX = "assets/prefabs/effects/battle/sfx_c1_ui_line_b0%s.prefab"
|
BattleConst.LINE_SFX = "assets/prefabs/effects/battle/sfx_c1_ui_line_b0%s.prefab"
|
||||||
BattleConst.CHANGE_ELEMENT_SFX = "assets/prefabs/effects/battle/sfx_skill_b02.prefab"
|
BattleConst.CHANGE_ELEMENT_SFX = "assets/prefabs/effects/battle/sfx_skill_b02.prefab"
|
||||||
BattleConst.LINK_SMOKE = "assets/prefabs/effects/battle/sfx_piece_smoke_b01.prefab"
|
BattleConst.LINK_SMOKE = "assets/prefabs/effects/battle/sfx_piece_smoke_b0%s.prefab"
|
||||||
BattleConst.LINK_SMOKE = "assets/prefabs/effects/battle/sfx_piece_smoke_b01.prefab"
|
|
||||||
BattleConst.GRID_KILL_SFX = {
|
BattleConst.GRID_KILL_SFX = {
|
||||||
[BattleConst.ELEMENT_TYPE.RED] = "assets/prefabs/effects/battle/sfx_piece_qizi_posui_b04.prefab",
|
[BattleConst.ELEMENT_TYPE.RED] = "assets/prefabs/effects/battle/sfx_piece_qizi_posui_b04.prefab",
|
||||||
[BattleConst.ELEMENT_TYPE.YELLOW] = "assets/prefabs/effects/battle/sfx_piece_qizi_posui_b05.prefab",
|
[BattleConst.ELEMENT_TYPE.YELLOW] = "assets/prefabs/effects/battle/sfx_piece_qizi_posui_b05.prefab",
|
||||||
|
|||||||
@ -820,21 +820,25 @@ function BattleBaseUI:initUISfxs()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if self.root.lineSfxObjs then
|
if self.root.lineSfxObjs then
|
||||||
for index, info in pairs(self.root.lineSfxObjs) do
|
for index, list in pairs(self.root.lineSfxObjs) do
|
||||||
if info.obj then
|
for _, info in ipairs(list) do
|
||||||
info.obj:setActive(true)
|
if info.obj then
|
||||||
info.obj:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_EFFECT_HELPER):SetSortingOrder(self:getUIOrder(), BOARD_SFX_ORDER)
|
info.obj:setActive(true)
|
||||||
info.obj:setActive(false)
|
info.obj:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_EFFECT_HELPER):SetSortingOrder(self:getUIOrder(), BOARD_SFX_ORDER)
|
||||||
|
info.obj:setActive(false)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.root.smokeSfxObjs then
|
if self.root.smokeSfxObjs then
|
||||||
for index, info in pairs(self.root.smokeSfxObjs) do
|
for index, list in pairs(self.root.smokeSfxObjs) do
|
||||||
if info.obj then
|
for _, info in ipairs(list) do
|
||||||
info.obj:setActive(true)
|
if info.obj then
|
||||||
info.obj:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_EFFECT_HELPER):SetSortingOrder(self:getUIOrder(), BOARD_SFX_ORDER)
|
info.obj:setActive(true)
|
||||||
info.obj:setActive(false)
|
info.obj:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_EFFECT_HELPER):SetSortingOrder(self:getUIOrder(), BOARD_SFX_ORDER)
|
||||||
|
info.obj:setActive(false)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -882,17 +886,21 @@ function BattleBaseUI:hideAllBoardSfxs()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if self.root.lineSfxObjs then
|
if self.root.lineSfxObjs then
|
||||||
for index, info in pairs(self.root.lineSfxObjs) do
|
for _, list in pairs(self.root.lineSfxObjs) do
|
||||||
if info.obj then
|
for _, info in ipairs(list) do
|
||||||
info.obj:setActive(false)
|
if info.obj then
|
||||||
|
info.obj:setActive(false)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.root.smokeSfxObjs then
|
if self.root.smokeSfxObjs then
|
||||||
for index, info in pairs(self.root.smokeSfxObjs) do
|
for index, list in pairs(self.root.smokeSfxObjs) do
|
||||||
if info.obj then
|
for _, info in ipairs(list) do
|
||||||
info.obj:setActive(false)
|
if info.obj then
|
||||||
|
info.obj:setActive(false)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1470,7 +1478,7 @@ function BattleBaseUI:eliminationAni(aniSequence, effectGridMap, callback, side)
|
|||||||
end
|
end
|
||||||
self.eliminationAniSeq:Insert(time, baseObject:getTransform():DOScale(1.3, 0.1))
|
self.eliminationAniSeq:Insert(time, baseObject:getTransform():DOScale(1.3, 0.1))
|
||||||
self.eliminationAniSeq:InsertCallback(time + 0.2, function()
|
self.eliminationAniSeq:InsertCallback(time + 0.2, function()
|
||||||
self:getSfxSmoke(index, function(obj)
|
self:getSfxSmoke(entity:getElementType(), index, function(obj)
|
||||||
obj:setAnchoredPosition(pos.x, pos.y)
|
obj:setAnchoredPosition(pos.x, pos.y)
|
||||||
obj:play()
|
obj:play()
|
||||||
end)
|
end)
|
||||||
@ -2191,7 +2199,6 @@ function BattleBaseUI:hideAllSfxLine()
|
|||||||
info.obj:setActive(false)
|
info.obj:setActive(false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -2337,24 +2344,24 @@ function BattleBaseUI:getSfxGridEffect(effectSfxPath, func)
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleBaseUI:getSfxSmoke(index, func)
|
function BattleBaseUI:getSfxSmoke(elementType, index, func)
|
||||||
self.hidingAllSfxSmoke = false
|
self.hidingAllSfxSmoke = false
|
||||||
|
|
||||||
if not self.root.smokeSfxObjs then
|
self.root.smokeSfxObjs = self.root.smokeSfxObjs or {}
|
||||||
self.root.smokeSfxObjs = {}
|
self.root.smokeSfxObjs[elementType] = self.root.smokeSfxObjs[elementType] or {}
|
||||||
end
|
if self.root.smokeSfxObjs[elementType] and self.root.smokeSfxObjs[elementType][index] then
|
||||||
if self.root.smokeSfxObjs[index] then
|
if self.root.smokeSfxObjs[elementType][index].obj and func then
|
||||||
if self.root.smokeSfxObjs[index].obj and func then
|
local obj = self.root.smokeSfxObjs[elementType][index].obj
|
||||||
local obj = self.root.smokeSfxObjs[index].obj
|
|
||||||
obj:setActive(true)
|
obj:setActive(true)
|
||||||
func(obj)
|
func(obj)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self.root.smokeSfxObjs[index] = {
|
self.root.smokeSfxObjs[elementType][index] = {
|
||||||
isLoaded = true
|
isLoaded = true
|
||||||
}
|
}
|
||||||
EffectManager:loadUIEffectAsync(GConst.BattleConst.LINK_SMOKE, self, self.gridNode, BOARD_SFX_ORDER, function(obj)
|
local str = string.format(GConst.BattleConst.LINK_SMOKE, elementType)
|
||||||
self.root.smokeSfxObjs[index].obj = obj
|
EffectManager:loadUIEffectAsync(str, self, self.gridNode, BOARD_SFX_ORDER, function(obj)
|
||||||
|
self.root.smokeSfxObjs[elementType][index].obj = obj
|
||||||
obj:setLocalScale(1.5, 1.5, 1.5)
|
obj:setLocalScale(1.5, 1.5, 1.5)
|
||||||
if self.hidingAllSfxSmoke then
|
if self.hidingAllSfxSmoke then
|
||||||
obj:setActive(false)
|
obj:setActive(false)
|
||||||
@ -2372,9 +2379,11 @@ function BattleBaseUI:hideAllSfxSmoke()
|
|||||||
if not self.root.smokeSfxObjs then
|
if not self.root.smokeSfxObjs then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
for inde, info in pairs(self.root.smokeSfxObjs) do
|
for inde, list in pairs(self.root.smokeSfxObjs) do
|
||||||
if info.obj then
|
for _, info in ipairs(list) do
|
||||||
info.obj:setActive(false)
|
if info.obj then
|
||||||
|
info.obj:setActive(false)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user