PlaySFX

Method

PlaySFX has 3 overloads.

PlaySFX(SpatialSFX, float, float)

Plays the given SFX with a cached AudioSource.

Definition

void PlaySFX(SpatialSFX sfx, float extraVolume = 0, float extraPitch = 0)
void PlaySFX(SpatialSFX sfx, float extraVolume = 0, float extraPitch = 0)

Parameters

ParameterDescription
SpatialSFX sfx

SFX clip to play

float extraVolume

Extra volume to add to the clip

float extraPitch

Extra pitch to add to the clip

PlaySFX(SpatialSFX, Vector3, float, float)

Plays the given SFX with a cached AudioSource at a given position.

Definition

void PlaySFX(SpatialSFX sfx, Vector3 position, float extraVolume = 0, float extraPitch = 0)
void PlaySFX(SpatialSFX sfx, Vector3 position, float extraVolume = 0, float extraPitch = 0)

Parameters

ParameterDescription
SpatialSFX sfx

SFX clip to play

Vector3 position

Position to play the clip at

float extraVolume

Extra volume to add to the clip

float extraPitch

Extra pitch to add to the clip

PlaySFX(SpatialSFX, AudioSource, float, float)

Plays the given SFX on the provided AudioSource.

Definition

void PlaySFX(SpatialSFX sfx, AudioSource source, float extraVolume = 0, float extraPitch = 0)
void PlaySFX(SpatialSFX sfx, AudioSource source, float extraVolume = 0, float extraPitch = 0)

Parameters

ParameterDescription
SpatialSFX sfx

SFX clip to play

AudioSource source

AudioSource to play the clip on

float extraVolume

Extra volume to add to the clip

float extraPitch

Extra pitch to add to the clip