///
/// 音频系统常量定义
///
public static class AudioConstant
{
#region Playback Limits
///
/// 最大音乐播放数
///
public const int MaxMusicCount = 1;
///
/// 最大音效播放数
///
public const int MaxSoundCount = 100;
///
/// 最大语音播放数
///
public const int MaxSpeakCount = 1;
///
/// 音乐播放池上限
///
public const int MusicPlayingLimit = 1;
///
/// 音效播放池上限
///
public const int SoundPlayingLimit = 100;
///
/// 语音播放池上限
///
public const int SpeakPlayingLimit = 1;
#endregion
#region Priority Values
///
/// 最高优先级
///
public const int MaxPriority = 99;
///
/// 最低优先级
///
public const int MinPriority = 0;
///
/// 默认优先级
///
public const int DefaultPriority = 29;
///
/// 低优先级
///
public const int LowPriority = 30;
#endregion
#region Fade Duration
///
/// 默认淡入时长(秒)
///
public const float DefaultFadeInDuration = 2f;
///
/// 默认淡出时长(秒)
///
public const float DefaultFadeOutDuration = 2f;
#endregion
#region Stopped Pool Limits
///
/// 音乐停止池上限
///
public const int MusicStoppedLimit = 5;
///
/// 音效停止池上限
///
public const int SoundStoppedLimit = 50;
///
/// 语音停止池上限
///
public const int SpeakStoppedLimit = 3;
#endregion
}
///
/// 音频池容量配置
/// 用于配置播放池和停止池的容量上限
///
public struct AudioPoolConfig
{
///
/// 音乐播放池上限
///
public int MusicPlayingLimit;
///
/// 音效播放池上限
///
public int SoundPlayingLimit;
///
/// 语音播放池上限
///
public int SpeakPlayingLimit;
///
/// 音乐停止池上限
///
public int MusicStoppedLimit;
///
/// 音效停止池上限
///
public int SoundStoppedLimit;
///
/// 语音停止池上限
///
public int SpeakStoppedLimit;
///
/// 默认配置
///
public static AudioPoolConfig Default => new AudioPoolConfig
{
MusicPlayingLimit = AudioConstant.MusicPlayingLimit,
SoundPlayingLimit = AudioConstant.SoundPlayingLimit,
SpeakPlayingLimit = AudioConstant.SpeakPlayingLimit,
MusicStoppedLimit = AudioConstant.MusicStoppedLimit,
SoundStoppedLimit = AudioConstant.SoundStoppedLimit,
SpeakStoppedLimit = AudioConstant.SpeakStoppedLimit,
};
}