Adventure Creator
1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
|
Public Member Functions | |
virtual void | _Update () |
void | Interact () |
void | FadeIn (float _fadeTime, bool loop, int _timeSamples=0) |
Fades in the AudioSource's current AudioClip, after which it continues to play. More... | |
void | FadeOut (float _fadeTime) |
Fades out the AudioSource's current AudioClip, after which it stops. More... | |
bool | IsFadingOut () |
Checks if the AudioSource's AudioClip is being faded out. More... | |
void | Play () |
void | Play (bool loop) |
Plays the AudioSource's current AudioClip. More... | |
void | Play (AudioClip clip, bool loop, int _timeSamples=0) |
Plays an AudioClip. More... | |
void | PlayAtPoint (bool loop, int samplePoint) |
Plays the AudioSource's current AudioClip from a set point. More... | |
void | SetMaxVolume () |
void | SetVolume (float volume) |
Sets the volume, but takes relativeVolume into account as well. More... | |
void | ChangeRelativeVolume (float newRelativeVolume, float changeTime=0f) |
Changes the relativeVolume value. More... | |
void | Stop () |
bool | IsFading () |
Checks if the sound is fading in or out. More... | |
bool | IsPlaying () |
Checks if sound is playing. More... | |
bool | IsPlaying (AudioClip clip) |
Checks if a particular AudioClip is playing. More... | |
void | TryDestroy () |
void | EndOld (SoundType _soundType, Sound ignoreSound) |
Fades out all sounds of a particular type being played. More... | |
SoundData | GetSaveData (SoundData soundData) |
Updates a SoundData class with its own variables that need saving. More... | |
void | LoadData (SoundData soundData) |
Updates its own variables from a SoundData class. More... | |
Public Attributes | |
SoundType | soundType |
bool | playWhilePaused = false |
float | relativeVolume = 1f |
bool | surviveSceneChange = false |
Protected Attributes | |
float | maxVolume = 1f |
float | smoothVolume = 1f |
float | smoothUpdateSpeed = 20f |
float | fadeTime |
float | originalFadeTime |
FadeType | fadeType |
Options | options |
AudioSource | _audioSource |
float | otherVolume = 1f |
float | originalRelativeVolume |
float | targetRelativeVolume |
float | relativeChangeTime |
float | originalRelativeChangeTime |
bool | gameIsPaused |
Properties | |
AudioSource | audioSource [get] |
This component controls the volume of the AudioSource component it is attached beside, according to the volume levels set within OptionsData by the player. It also allows for AudioSources to be controlled using Actions.
|
virtual |
Updates the AudioSource's volume. This is called every frame by StateHandler.
Reimplemented in AC.Soundtrack.
void AC.Sound.ChangeRelativeVolume | ( | float | newRelativeVolume, |
float | changeTime = 0f |
||
) |
Changes the relativeVolume value.
newRelativeVolume | The new value for relativeVolume |
changeTime | The time, in seconds, to make the change in |
void AC.Sound.EndOld | ( | SoundType | _soundType, |
Sound | ignoreSound | ||
) |
Fades out all sounds of a particular type being played.
soundType | If the soundType matches this, the sound will end |
ignoreSound | The Sound object to not affect |
void AC.Sound.FadeIn | ( | float | _fadeTime, |
bool | loop, | ||
int | _timeSamples = 0 |
||
) |
Fades in the AudioSource's current AudioClip, after which it continues to play.
_fadeTime | The fade duration, in seconds |
loop | If True, then the AudioClip will loop |
_timeSamples | The timeSamples to play from |
void AC.Sound.FadeOut | ( | float | _fadeTime | ) |
Fades out the AudioSource's current AudioClip, after which it stops.
_fadeTime | The fade duration, in seconds |
void AC.Sound.Interact | ( | ) |
Plays the AudioSource's current AudioClip.
bool AC.Sound.IsFading | ( | ) |
Checks if the sound is fading in or out.
bool AC.Sound.IsFadingOut | ( | ) |
Checks if the AudioSource's AudioClip is being faded out.
bool AC.Sound.IsPlaying | ( | ) |
Checks if sound is playing.
bool AC.Sound.IsPlaying | ( | AudioClip | clip | ) |
Checks if a particular AudioClip is playing.
clip | The AudioClip to check for |
void AC.Sound.LoadData | ( | SoundData | soundData | ) |
void AC.Sound.Play | ( | ) |
Plays the AudioSource's current AudioClip, without starting over if it was paused or changing its "loop" variable.
void AC.Sound.Play | ( | AudioClip | clip, |
bool | loop, | ||
int | _timeSamples = 0 |
||
) |
Plays an AudioClip.
clip | The AudioClip to play |
loop | If true, the AudioClip will be looped |
_timeSamples | The timeSamples to play from |
void AC.Sound.Play | ( | bool | loop | ) |
Plays the AudioSource's current AudioClip.
loop | If true, the AudioClip will be looped |
void AC.Sound.PlayAtPoint | ( | bool | loop, |
int | samplePoint | ||
) |
Plays the AudioSource's current AudioClip from a set point.
loop | If true, the AudioClip will be looped |
samplePoint | The playback position in PCM samples |
void AC.Sound.SetMaxVolume | ( | ) |
Calculates the maximum volume that the AudioSource can have. This should be called whenever the volume in OptionsData is changed.
void AC.Sound.SetVolume | ( | float | volume | ) |
Sets the volume, but takes relativeVolume into account as well.
volume | The volume to set |
void AC.Sound.Stop | ( | ) |
Abruptly stops the currently-playing sound.
void AC.Sound.TryDestroy | ( | ) |
Destroys itself, if it should do.
bool AC.Sound.playWhilePaused = false |
If True, then the sound can play when the game is paused
float AC.Sound.relativeVolume = 1f |
The volume of the sound, relative to its categoriy's "global" volume set within OptionsData
SoundType AC.Sound.soundType |
The type of sound, so far as volume levels go (SFX, Music, Other)
bool AC.Sound.surviveSceneChange = false |
If True, then the GameObject this is attached to will not be destroyed when changing scene
|
get |
The AudioSource that AudioClip assets are played from