Version: Unity 6.3 Beta (6000.3)
LanguageEnglish
  • C#

IAudioGenerator

interface in UnityEngine.Audio


Implements interfaces:ICapabilities

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Factory for instantiating GeneratorInstance to be used internally or from other scripts.

IAudioGenerators do not own any created GeneratorInstance instances, nor should they try to store these for scripting. Instead, the user of the IAudioGenerator should expose the created GeneratorInstance through their own API.



IAudioGenerators are generally implemented on a MonoBehaviour or a ScriptableObject to bind together asset/scene management and audio generation tools with a uniform interface. You can also directly instantiate a GeneratorInstance using a ControlContext purely in code.





If you want to serialize a reference to a IAudioGenerator and have an object picker for asset / component based factories, use the IAudioGenerator.Serializable utility to store/load these references.

Additional resources: AudioSource.generator, AudioSource.generatorInstance

Public Methods

Method Description
CreateRuntime Ask this interface to instantiate a runtime GeneratorInstance instance.