Managing Sound Sources
Remember to use the Esper.USound
namespace when scripting.
A Sound Source is just an extension of an Audio Source. You can access the audio source by simply using SoundSource.audioSource
.
Creating a Sound Source
Creating a sound source can be done in a single line. Here we create a sound source with the name FX.
Remember, sound source names need to be unique (except for copies). We can create a copy of FX as so:
Getting a Sound Source
Defaults
You can access the default one-shot and background music sound sources by their cached variables.
Custom
You can find a custom sound source with it's unique name.
Copy
A copy of a sound source is saved in the sound source that was copied. Copies are for very niche purposes and there is no 'good' way of getting one.
It's recommended that a copy is cached when created if you need to edit it's values for whatever reason.
The name of a copy does not need to be unique.
Deleting a Sound Source
Default sound sources cannot be deleted. A main sound source can be deleted like this:
A copy must be deleted from the main sound source that was copied.
Last updated