Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IAudioEffect

Factory for instantiating EffectInstance to be used internally or from other scripts.
Read time 1 minuteLast updated 2 days ago

Definition

public interface IAudioEffect : EffectInstance.ICapabilities

Remarks

Implement IAudioEffect on a MonoBehaviour and add the component to the same GameObject as an AudioSource to process the audio source's signal with the effect. The audio source discovers the component automatically, calls IAudioEffect.CreateInstance, and owns the returned EffectInstance. Use AudioSource.GetEffectInstance to interact with the instance while it is playing.
IAudioEffects do not own any created EffectInstance instances, and they don't try to store these for scripting.
If you want to serialize a reference to a IAudioEffect, use the IAudioEffect.Serializable utility to store/load these references.

Methods

Method

Description

CreateInstanceAsk this interface to create an EffectInstance.

Structs

Struct

Description

IAudioEffect.SerializableA helper struct that allows you to serialize a reference to any Object, MonoBehaviour or ScriptableObject that implements IAudioEffect.