6 namespace HKI.Core.Audio.Editor
21 Assembly unityEditorAssembly = typeof(AudioImporter).Assembly;
23 Type audioUtilClass = unityEditorAssembly.GetType(
"UnityEditor.AudioUtil");
25 MethodInfo method = audioUtilClass.GetMethod(
"PlayClip", BindingFlags.Static | BindingFlags.Public, null,
new System.Type[] { typeof(AudioClip) }, null);
27 method.Invoke(null,
new object[] { clip });
35 Assembly unityEditorAssembly = typeof(AudioImporter).Assembly;
37 Type audioUtilClass = unityEditorAssembly.GetType(
"UnityEditor.AudioUtil");
39 MethodInfo method = audioUtilClass.GetMethod(
"IsClipPlaying", BindingFlags.Static | BindingFlags.Public, null,
new System.Type[] { typeof(AudioClip) }, null);
41 return (
bool)method.Invoke(null,
new object[] { clip });
46 Assembly unityEditorAssembly = typeof(AudioImporter).Assembly;
48 Type audioUtilClass = unityEditorAssembly.GetType(
"UnityEditor.AudioUtil");
50 MethodInfo method = audioUtilClass.GetMethod(
"StopAllClips", BindingFlags.Static | BindingFlags.Public, null,
new Type[] { }, null);
51 method.Invoke(null,
new object[] { });
static void PlayClip(AudioClip clip)
This class provides the capability to listen into audio clips in the editor.
static bool IsClipPlaying(AudioClip clip)
static void StopClipPlaying()