MeatMotion

AudioMotionExtensions

Bind a float to AudioSource volume or pitch or to an exposed AudioMixer parameter.

Namespace
MeatMotion.Extensions
Assembly
MeatMotion

Jump to members

public static class AudioMotionExtensions

Requires com.unity.modules.audio

AudioMotionExtensions.cs · L7

Members

BindToVolume

Schedule a tween that writes the interpolated value to Volume on the bound target and return its MotionHandle.

public static MotionHandle BindToVolume(this FloatMotionBuilder builder, AudioSource audioSource)
Parameters and return value
builder
this FloatMotionBuilder Configured builder, passed as the receiver for extension calls.
audioSource
AudioSource Target AudioSource that receives the update.
Returns
MotionHandle
public static MotionHandle BindToVolume<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, AudioSource audioSource)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
Parameters and return value
builder
this MotionBuilder<float, TOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
audioSource
AudioSource Target AudioSource that receives the update.
Returns
MotionHandle

BindToPitch

Schedule a tween that writes the interpolated value to Pitch on the bound target and return its MotionHandle.

public static MotionHandle BindToPitch(this FloatMotionBuilder builder, AudioSource audioSource)
Parameters and return value
builder
this FloatMotionBuilder Configured builder, passed as the receiver for extension calls.
audioSource
AudioSource Target AudioSource that receives the update.
Returns
MotionHandle
public static MotionHandle BindToPitch<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, AudioSource audioSource)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
Parameters and return value
builder
this MotionBuilder<float, TOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
audioSource
AudioSource Target AudioSource that receives the update.
Returns
MotionHandle

BindToAudioMixerFloat

Schedule a tween that writes the interpolated value to AudioMixerFloat on the bound target and return its MotionHandle.

public static MotionHandle BindToAudioMixerFloat(this FloatMotionBuilder builder, AudioMixer audioMixer, string name)
Parameters and return value
builder
this FloatMotionBuilder Configured builder, passed as the receiver for extension calls.
audioMixer
AudioMixer Target AudioMixer that receives the update.
name
string Name of the target property.
Returns
MotionHandle
public static MotionHandle BindToAudioMixerFloat<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, AudioMixer audioMixer, string name)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
Parameters and return value
builder
this MotionBuilder<float, TOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
audioMixer
AudioMixer Target AudioMixer that receives the update.
name
string Name of the target property.
Returns
MotionHandle