Click or drag to resize
FadingAudioSource Class
Audio source that fades between clips instead of playing them immediately.
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          Slash.Unity.Common.SoundFadingAudioSource

Namespace: Slash.Unity.Common.Sound
Assembly: Slash.Unity.Common (in Slash.Unity.Common.dll) Version: 1.0.6018.40182
Syntax
public class FadingAudioSource : MonoBehaviour

The FadingAudioSource type exposes the following members.

Constructors
  NameDescription
Public methodFadingAudioSource
Initializes a new instance of the FadingAudioSource class
Top
Properties
  NameDescription
Public propertyClip
Current clip of the audio source.
Public propertyIsPlaying
Whether the audio source is currently playing a clip.
Public propertyLoop
Whether the audio source is looping the current clip.
Public propertyVolume
Current volume of the audio source.
Top
Methods
  NameDescription
Public methodFade(AudioClip, Single, Boolean)
If the audio source is enabled and playing, fades out the current clip and fades in the specified one, after. If the audio source is enabled and not playing, fades in the specified clip immediately. If the audio source is not enabled, fades in the specified clip as soon as it gets enabled.
Public methodFade(AudioClip, AudioClip, Single)
If the audio source is enabled and playing, fades out the current clip and fades in the specified intro clip, after. If the audio source is enabled and not playing, fades in the specified intro clip immediately. If the audio source is not enabled, fades in the specified intro clip as soon as it gets enabled. After the intro clip has finished, starts looping the loop clip immediately, without fading.
Public methodFade(AudioClip, Single, Boolean, Single)
If the audio source is enabled and playing, fades out the current clip and fades in the specified one, after. If the audio source is enabled and not playing, fades in the specified clip immediately. If the audio source is not enabled, fades in the specified clip as soon as it gets enabled.
Public methodFadeOut
Fades out the current audio clip, stopping the clip after.
Public methodPlay
Continues fading in the current audio clip.
Public methodStop
Stop playing the current audio clip immediately.
Top
Fields
  NameDescription
Public fieldFadeOutThreshold
Volume to end the previous clip at.
Public fieldFadeSpeed
Volume change per second when fading.
Top
See Also