GetEffectInstance<TComponent>(TComponent)
Gets a handle to the effect instantiated from a specific IAudioEffect component attached to this AudioSource 's GameObject.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.AudioModule
GetEffectInstance<T>(T)
public ProcessorInstance GetEffectInstance<TComponent>(TComponent effectComponent) where TComponent : Component, IAudioEffect
Parameters
Component implementing IAudioEffect on the same GameObject as this AudioSource.
Returns
Type | Description |
|---|---|
| ProcessorInstance | The ProcessorInstance for the effect, or a default-initialized instance if the component has no instantiated effect. |
Remarks
Use this for runtime scripting control of an attached effect while it is playing, for example to send messages with ControlContext.SendMessage. Since the AudioSource owns the instance, check for its existence using ControlContext.Exists.