public void StopVoiceTest() { #if UNITY_EDITOR UnityEditor.EditorPrefs.SetInt("SimulateAssetBundles", 1); #endif ResMgr.Init(); var loader = ResLoader.Allocate(); // 提前预加载,否则会进行异步加载 loader.LoadSync <AudioClip>("sound1"); AudioKit.Settings.IsVoiceOn.Value = true; AudioKit.PlayVoice("sound1"); Assert.IsTrue(AudioKit.VoicePlayer.AudioSource.isPlaying); Assert.IsTrue(AudioKit.VoicePlayer.AudioSource.clip); AudioKit.StopVoice(); Assert.IsFalse(AudioKit.VoicePlayer.AudioSource.isPlaying); Assert.IsFalse(AudioKit.VoicePlayer.AudioSource.clip); loader.Recycle2Cache(); loader = null; }