chore: initial commit
This commit is contained in:
24
Assets/Scripts/Core/NullAudioService.cs
Normal file
24
Assets/Scripts/Core/NullAudioService.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace BaseGames.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// IAudioService 的空实现,作为兜底防止 NullReferenceException。
|
||||
/// 在 GameServiceRegistrar 中作为默认音频服务注册;
|
||||
/// Phase 2 Audio 模块实现完整后替换。
|
||||
/// </summary>
|
||||
public sealed class NullAudioService : IAudioService
|
||||
{
|
||||
public void PlayBGM(string key)
|
||||
=> Debug.LogWarning($"[NullAudioService] PlayBGM({key}) — 音频系统未初始化。");
|
||||
|
||||
public void StopBGM(float fadeTime = 0f)
|
||||
=> Debug.LogWarning("[NullAudioService] StopBGM — 音频系统未初始化。");
|
||||
|
||||
public void PlaySFX(string key)
|
||||
=> Debug.LogWarning($"[NullAudioService] PlaySFX({key}) — 音频系统未初始化。");
|
||||
|
||||
public void SetVolume(string group, float normalizedVolume)
|
||||
=> Debug.LogWarning($"[NullAudioService] SetVolume({group}, {normalizedVolume}) — 音频系统未初始化。");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user