Audio Emitter
Description
AudioEmitter is an AudioSource preset used by the AudioManager, making it quick and less manual for setting up, through code.
Public Properties
| Property | Function |
|---|---|
| IsPlaying | Is the clip playing right now? (Read Only) |
Public Methods
| Method | Function |
|---|---|
| AudioEmitter | Creates a new AudioEmitter. |
| Play | Plays an AudioClip in the AudioEmitter if it's not being already used. |
| ForcePlay | Forces the AudioEmitter to stop playing the current AudioClip and play immediately the requested sound. |
| Stop | Immediately stop playing the current AudioClip. |
| CalculateVolumeByPercent | Calculate the AudioEmitter volume by using the formula: (volume = 1 - value / startValue). Useful when you need to start playing a sound at certain point. e.g when the character vitality is below certain point, it will increase the volume as the vitality gets lower. |
| GetVolume | Returns the volume value adjusted by its category. |