AudioControl
A class in Root.Township, the global namespace.
Plays one Wwise event on a game object and lets you stop, seek or reapply sound properties while it plays. Builds on SimpleAudioControl.
- Listed in Global namespace: A to B
- Inherits or implements
SimpleAudioControl
Constructors
| Member | What it is |
|---|---|
AudioControl() | Creates an AudioControl with default values. |
Fields
1 private and internal field
Properties
| Member | What it is |
|---|---|
AkGameObj AkGameObj { get; private set; } | The Wwise game object the sound plays on. Null once it has finished. |
bool IsExhausted { get; } | True when nothing is playing, so Stop and Seek do nothing. |
Event SoundEvent { get; private set; } | The Wwise event being played. Null once it has finished. |
HashSet<ISoundProperty> soundProperties { get; private set; } | Sound properties added by Play. They aren't cleared between plays. |
Methods
| Member | What it is |
|---|---|
override void Play(Event soundEvent, AkGameObj akGameObj, Action endAction = null, params ISoundProperty[] soundProperties) | Stops any sound already playing, then plays the event with the given sound properties and an optional end callback. |
void ReapplySoundProperties() | Applies all stored sound properties to the game object again. |
bool Seek(float timePercentage) | Jumps the playing sound to a point given as a fraction of its length. False if nothing is playing. |
bool Stop() | Stops the playing sound. False if nothing was playing. |
1 private and internal method
Used in
Members of other types that take, return or hold a AudioControl:
Smelter.smelterActiveAudioControl, CookingLiquid.spawnedAudio, WaterfallEffectGenerator.sounds, AudioManager.PlayInternal, AudioManager.PlayInternalOneShot, AudioManager.PlaySoundEffect, AudioManager.PlaySoundEffectAt, AudioManager.PlaySoundEffectOnObject, LoopingSoundEffect.loopingSoundAudioControl, SoundSource.audioControl.