Merge branch '音效修改' into master_develop
commit
a4ffc54ba0
|
|
@ -497,8 +497,24 @@ function SoundManager.SetBgmEnabled(b)
|
||||||
_bgm_enabled = b
|
_bgm_enabled = b
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 设置音效播放速度
|
||||||
|
function SoundManager.SetAudioSpeed(speed)
|
||||||
|
speed = speed or 1
|
||||||
|
for _, unit in ipairs(_backgroundSound) do
|
||||||
|
unit.audio.pitch = speed
|
||||||
|
end
|
||||||
|
for _, unit in ipairs(_soundChannel) do
|
||||||
|
unit.audio.pitch = speed
|
||||||
|
end
|
||||||
|
for _, unit in ipairs(_AmbientChannel) do
|
||||||
|
unit.audio.pitch = speed
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function SoundManager.Dispose()
|
function SoundManager.Dispose()
|
||||||
SoundManager.Clear()
|
SoundManager.Clear()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--endregion
|
--endregion
|
||||||
|
|
|
||||||
|
|
@ -632,6 +632,8 @@ function this.SetTimeScale(TimeScale)
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.Battle.OnTimeScaleChanged)
|
Game.GlobalEvent:DispatchEvent(GameEvent.Battle.OnTimeScaleChanged)
|
||||||
-- 真正生效的敌方
|
-- 真正生效的敌方
|
||||||
Time.timeScale = TimeScale
|
Time.timeScale = TimeScale
|
||||||
|
-- 设置音效播放的速度
|
||||||
|
SoundManager.SetAudioSpeed(TimeScale)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -294,6 +294,8 @@ function this.BattleEnd(result)
|
||||||
BattleManager.PauseBattle()
|
BattleManager.PauseBattle()
|
||||||
-- 强制停止倍速
|
-- 强制停止倍速
|
||||||
Time.timeScale = 1
|
Time.timeScale = 1
|
||||||
|
-- 设置音效播放的速度
|
||||||
|
SoundManager.SetAudioSpeed(1)
|
||||||
--用一个变量接收最近的战斗结果
|
--用一个变量接收最近的战斗结果
|
||||||
this.lastBattleResult = {
|
this.lastBattleResult = {
|
||||||
result = result,
|
result = result,
|
||||||
|
|
@ -489,6 +491,8 @@ function this:OnClose()
|
||||||
-- BattleManager.SetTimeScale(1)
|
-- BattleManager.SetTimeScale(1)
|
||||||
-- 真正生效的敌方
|
-- 真正生效的敌方
|
||||||
Time.timeScale = 1
|
Time.timeScale = 1
|
||||||
|
-- 设置音效播放的速度
|
||||||
|
SoundManager.SetAudioSpeed(1)
|
||||||
if endFunc then
|
if endFunc then
|
||||||
endFunc(this.lastBattleResult)
|
endFunc(this.lastBattleResult)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -354,9 +354,9 @@ function this.EnemyAppear()
|
||||||
|
|
||||||
if index == 4 then
|
if index == 4 then
|
||||||
-- 提前播放音效
|
-- 提前播放音效
|
||||||
if BattleLogic.CurOrder == 1 then
|
-- if BattleLogic.CurOrder == 1 then
|
||||||
SoundManager.PlaySound(SoundConfig.Sound_BattleStart_04)
|
-- SoundManager.PlaySound(SoundConfig.Sound_BattleStart_04)
|
||||||
end
|
-- end
|
||||||
|
|
||||||
elseif index == 6 then
|
elseif index == 6 then
|
||||||
--显示血条
|
--显示血条
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue