Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.MusicCrossfade Class Reference
Inheritance diagram for AC.MusicCrossfade:

Public Member Functions

void _Update ()
 
void Stop ()
 

Static Public Member Functions

static MusicCrossfade FadeOut (Soundtrack soundtrack, AudioSource audioSourceToCopy, float _fadeTime)
 Fades out a new AudioSource More...
 

Protected Attributes

AudioSource _audioSource
 
float fadeTime = 0f
 
float originalFadeTime = 0f
 
float originalVolume = 0f
 

Detailed Description

Handles the fading-out half of crossfading music. When music crossfades, the original track is copied here to be fade out, while the Music object fades in the next track.

Member Function Documentation

◆ _Update()

void AC.MusicCrossfade._Update ( )

Updates the AudioSource's volume. This is called every frame by Music.

◆ FadeOut()

static MusicCrossfade AC.MusicCrossfade.FadeOut ( Soundtrack  soundtrack,
AudioSource  audioSourceToCopy,
float  _fadeTime 
)
static

Fades out a new AudioSource

Parameters
audioSourceToCopyThe AudioSource to copy clip and volume data from
_fadeTimeThe duration, in seconds, of the fade effect

◆ Stop()

void AC.MusicCrossfade.Stop ( )

Stops the current audio immediately.