diff --git a/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua b/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua index 3c465b458b..fb5045aaab 100644 --- a/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Story/StoryDialoguePanel.lua @@ -179,11 +179,11 @@ function this.RefreshPanel(eventId, isFirstOpen) contexts = string.gsub(contexts, Language[11248], NameManager.roleName) contexts = string.gsub(contexts, "{ta}", NameManager.roleSex == ROLE_SEX.BOY and "他" or "她") -- 配音资源名 - -- local voice = chapterEventPointData[eventId].VoiceRes - -- if voice then - -- -- 使用相同通道播放,避免跳过剧情导致音效重复 - -- SoundManager.PlaySound(voice, nil, nil, 10) - -- end + local voice = chapterEventPointData[eventId].VoiceRes + if voice and IS_PLAY_VOICE then + -- 使用相同通道播放,避免跳过剧情导致音效重复 + SoundManager.PlaySound(voice, nil, nil, 10) + end --当前不是选择界面 if isRightType then diff --git a/Assets/ManagedResources/~Lua/Modules/Story/StoryMapPanel.lua b/Assets/ManagedResources/~Lua/Modules/Story/StoryMapPanel.lua index de3352db40..b24f3917a7 100644 --- a/Assets/ManagedResources/~Lua/Modules/Story/StoryMapPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Story/StoryMapPanel.lua @@ -479,6 +479,7 @@ function this:EnterFight() end function this:CloseDiaLog() + SoundManager.StopSoundByChannel(10) this.showDiaLog = false this.dialog.gameObject:SetActive(false) this.GoOn.gameObject:SetActive(false) @@ -526,6 +527,11 @@ function this:ShowDialog() local contexts =(contents[2]) contexts = string.gsub(contexts, Language[11248], NameManager.roleName) contexts = string.gsub(contexts, "{ta}", NameManager.roleSex == ROLE_SEX.BOY and "他" or "她") + local voice = config.VoiceRes + if voice and IS_PLAY_VOICE then + -- 使用相同通道播放,避免跳过剧情导致音效重复 + SoundManager.PlaySound(voice, nil, nil, 10) + end --this.diaLogNameText.text = "" ShowText(this.diaLogContent.transform, contexts, 1) this.SetList2d(resId,setId,live2dRoot) @@ -636,6 +642,7 @@ end --界面关闭时调用(用于子类重写) function StoryMapPanel:OnClose() + SoundManager.StopSoundByChannel(10) isFirstEnter = 1 for k,v in pairs(this.PlayerGrouops) do SubUIManager.Close(v)