22 lines
768 B
C#
22 lines
768 B
C#
namespace BaseGames.Core
|
||
{
|
||
/// <summary>
|
||
/// 音频服务接口。
|
||
/// 实现由 BaseGames.Audio 程序集提供;Core 层注册 NullAudioService 作为兜底。
|
||
/// </summary>
|
||
public interface IAudioService
|
||
{
|
||
/// <summary>播放背景音乐(循环)。key 对应 Addressables 地址或 Audio Mixer 键。</summary>
|
||
void PlayBGM(string key);
|
||
|
||
/// <summary>停止背景音乐。fadeTime > 0 则淡出。</summary>
|
||
void StopBGM(float fadeTime = 0f);
|
||
|
||
/// <summary>单次播放音效。</summary>
|
||
void PlaySFX(string key);
|
||
|
||
/// <summary>设置混音器音量(0–1)。group 取 AudioMixerKeys 常量。</summary>
|
||
void SetVolume(string group, float normalizedVolume);
|
||
}
|
||
}
|