RandomAudioPlayer
A class in Root.Township, the global namespace.
Client: plays a random sound from a SoundEffectSet on this object over and over, with a random delay between plays.
- Listed in Global namespace: Q to R
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
RandomAudioPlayer() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private float averageLength | Seconds added to each delay to allow for the sound's length. |
private bool hasBeenDestroyed | Set on destroy to stop the play loop. |
private float maxDelay | Longest random wait between sounds. |
private float minDelay | Shortest random wait between sounds. |
private SoundEffectSet set | Sound set to play from. |