private void Init() { var prefab = AudioStream.CreateFromSource(new GameObject().AddComponent <AudioSource>()); prefab.name = "AudioStream_Prefab"; prefab.Source.spatialBlend = 0f; prefab.Source.maxDistance = float.MaxValue; prefab.Source.minDistance = float.MinValue; _audioStreamPool = Pool.Create(prefab.gameObject, 10, "Pool_AudioStreams"); DontDestroyOnLoad(_audioStreamPool.gameObject); DontDestroyOnLoad(prefab.gameObject); }
public static AudioStream.Builder GetBuilder(AudioSource source) { var builder = new AudioStream.Builder(AudioStream.CreateFromSource(source)); return(builder); }