2024-07-08 15:28:18 +08:00
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
|
|
|
|
|
|
public partial class SROptions
|
|
|
|
|
|
{
|
|
|
|
|
|
[Category("音频")]
|
|
|
|
|
|
[DisplayName("音频ID")]
|
2024-07-24 16:41:58 +08:00
|
|
|
|
public string AudioKey
|
2024-07-08 15:28:18 +08:00
|
|
|
|
{
|
|
|
|
|
|
set;
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Category("音频")]
|
|
|
|
|
|
[DisplayName("播放音频")]
|
|
|
|
|
|
public async void Play()
|
|
|
|
|
|
{
|
2024-07-24 16:41:58 +08:00
|
|
|
|
int audioID = AudioManager.Instance.PlayAudio(AudioKey);
|
2024-07-08 15:28:18 +08:00
|
|
|
|
if (audioID < 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("Debug, Audio播放失败,请检查AudioID!");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-07-08 16:47:36 +08:00
|
|
|
|
|
|
|
|
|
|
[Category("音频")]
|
|
|
|
|
|
[DisplayName("停止背景音乐")]
|
|
|
|
|
|
public void StopBGM()
|
|
|
|
|
|
{
|
|
|
|
|
|
AudioManager.Instance.AudioMgrObj.StopBGM();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Category("音频")]
|
|
|
|
|
|
[DisplayName("停止所有音频播放")]
|
|
|
|
|
|
public void StopAll()
|
|
|
|
|
|
{
|
|
|
|
|
|
AudioManager.Instance.AudioMgrObj.StopAll();
|
|
|
|
|
|
}
|
2024-07-08 15:28:18 +08:00
|
|
|
|
}
|