【音效】在关卡界面开关排行榜,背景音乐不会随着切换
parent
aa8989ae73
commit
549d54871f
|
@ -44,6 +44,7 @@ local _amb_enabled = true
|
|||
|
||||
local _backgroundSound = {}
|
||||
local _backgroundRes
|
||||
local _backgroundResOld
|
||||
|
||||
local _AmbientChannel = {}
|
||||
local _AmbientRes
|
||||
|
@ -425,7 +426,7 @@ function SoundManager.PlayMusic(resName, isFade, callback)
|
|||
if not _backgroundSound then return end
|
||||
local audioUnit = _backgroundSound[1]
|
||||
if not audioUnit then return end
|
||||
|
||||
_backgroundResOld = _backgroundRes
|
||||
_backgroundRes = resName
|
||||
|
||||
local function _SetTimer()
|
||||
|
@ -462,6 +463,9 @@ function SoundManager.StopMusic()
|
|||
_backgroundRes = nil
|
||||
end
|
||||
|
||||
function SoundManager.PlayOldMusic()
|
||||
SoundManager.PlayMusic(_backgroundResOld)
|
||||
end
|
||||
---=============================环境音效============================================
|
||||
function SoundManager.PlayAmbient(resName)
|
||||
if not resName then return end
|
||||
|
|
|
@ -77,6 +77,7 @@ end
|
|||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function RankingSingleListPanel:OnClose()
|
||||
SoundManager.PlayOldMusic()
|
||||
RankingManager.isRequest=0
|
||||
this.noneImage:SetActive(false)
|
||||
-- if this.liveNode then
|
||||
|
|
Loading…
Reference in New Issue