Plays an AudioSource once and then returns it to the CoopObjectPooler.
More...
Plays an AudioSource once and then returns it to the CoopObjectPooler.
The PlayOnceAudio class is used to play sound effects. Once the PlaySound method is triggered it will automatically put itself back into the object pooler to be used againin the future.
◆ Awake()
void PlayOnceAudio.Awake |
( |
| ) |
|
Initializes the sound effect to be ready to be played.
◆ FixedUpdate()
void PlayOnceAudio.FixedUpdate |
( |
| ) |
|
Adjusts the pitch of the sound effect based on the time scale so that things sound lower when in slow motion.
◆ GetObjectPoolerKey()
string PlayOnceAudio.GetObjectPoolerKey |
( |
| ) |
|
◆ PlaySound() [1/2]
void PlayOnceAudio.PlaySound |
( |
float |
volume, |
|
|
float |
pitch |
|
) |
| |
Plays the sound effect at the given pitch and volume.
- Parameters
-
volume | Volume to play the sound effect at. |
pitch | Pitch to play the sound effect at. |
◆ PlaySound() [2/2]
void PlayOnceAudio.PlaySound |
( |
float |
volume | ) |
|
Plays the sound effect at the given volume and pitch 1.
- Parameters
-
volume | Volume to play the sound effect at. |
◆ audioSourcePrefab
AudioSource PlayOnceAudio.audioSourcePrefab |
◆ delay
float PlayOnceAudio.delay |
◆ poolKey
string PlayOnceAudio.poolKey |
◆ slowmoTimeScaleMultiplier
float PlayOnceAudio.slowmoTimeScaleMultiplier |
The documentation for this class was generated from the following file: