音效播放时机放在特效之前

dev_chengFeng
JieLing 2020-07-29 18:11:25 +08:00
parent 2e5b87250b
commit dadf5e2fe9
1 changed files with 6 additions and 5 deletions

View File

@ -17,16 +17,17 @@ local floatingEffect = "FloatingText"
local buffFloatingEffect = "BuffFloatingText"
local loadAsset = function(path, battleSorting)
local go = poolManager:LoadAsset(path, PoolManager.AssetType.GameObject)
local layer = tonumber(go.name) or 0
battleSorting = battleSorting or BattleManager.GetBattleSorting()
Util.AddParticleSortLayer(go, battleSorting - layer)
go.name = tostring(battleSorting)
--- 播放音效
local audioData = FEAConfig.GetAudioData(path)
if audioData then
SoundManager.PlaySound(audioData.name)
end
--
local go = poolManager:LoadAsset(path, PoolManager.AssetType.GameObject)
local layer = tonumber(go.name) or 0
battleSorting = battleSorting or BattleManager.GetBattleSorting()
Util.AddParticleSortLayer(go, battleSorting - layer)
go.name = tostring(battleSorting)
return go
end