feat: BGMController独立音频脚本—彻底脱离PageController复杂编辑历史

新增BGMController.cs挂在[Managers]上:
- Awake()中创建AudioSource(spatialBlend=0,vol=0.5)
- AssetDatabase兜底加载_homeBgClip/_experimentBgClip
- 静态方法PlayHomeBg/PlayExperimentBg/StopBgMusic
PageController调用改为BGMController.xxx
This commit is contained in:
yangbear
2026-07-01 22:00:41 +08:00
parent fa380b2ea5
commit e1a9f90d3f
4 changed files with 83 additions and 3 deletions
+3 -3
View File
@@ -128,8 +128,8 @@ public class PageController : MonoBehaviour
if (_uiManager != null)
_uiManager.enabled = (page == Page.Experiment);
if (page == Page.Home) PlayHomeBg(); // 背景音乐: 首页播 homeBg, 选固定方式时停, 实验启动时播 experimentBg
if (page == Page.Home) PlayHomeBg();
if (page == Page.Home) BGMController.PlayHomeBg(); // 背景音乐: 首页播 homeBg, 选固定方式时停, 实验启动时播 experimentBg
if (page == Page.Home) BGMController.PlayHomeBg();
Debug.Log($"PageController(编辑器预览): 切换到 [{page}]");
}
#endif
@@ -231,7 +231,7 @@ public class PageController : MonoBehaviour
Debug.Log($"PageController: GameManager 已设置 Mode=[{gm.CurrentMode}] Fixation=[{gm.CurrentFixationMethod}]");
// 隐藏所有UI面板,准备播放片头动画
StopBgMusic();
BGMController.StopBgMusic();
HideAllPages();
// 找到 OpeningFlowController 播放片头动画