【m】增添Reinitialize()重新初始化方法

This commit is contained in:
Han
2025-07-09 12:27:50 +08:00
parent 00dfc7cbe8
commit b52d83fdcd
2 changed files with 15 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ namespace Stary.Evo.AudioCore
SFX = new SFXPlayer(audioSourcePool);
Music = new MusicPlayer(audioSourcePool);
}
#region
/// <summary>
@@ -118,5 +119,18 @@ namespace Stary.Evo.AudioCore
#endregion
/// <summary>
/// 重新初始化
/// </summary>
/// <returns></returns>
public static void Reinitialize()
{
if (audioSourcePool == null) Initialize();
StopVoice();
StopAllSFX();
StopMusic();
}
}
}