기술 자료

Unity Engine

Unity Engine

GetEffectInstance<TComponent>(TComponent)

Gets a handle to the effect instantiated from a specific IAudioEffect component attached to this AudioSource 's GameObject.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.AudioModule

GetEffectInstance<T>(T)

public ProcessorInstance GetEffectInstance<TComponent>(TComponent effectComponent) where TComponent : Component, IAudioEffect

Parameters

effectComponent

T
Component implementing IAudioEffect on the same GameObject as this AudioSource.

Returns

Type

Description

ProcessorInstanceThe 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.