C# Класс FadingAudioSource, kaijurising

Наследование: MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
FadeOutThreshold float
FadeSpeed float

Открытые методы

Метод Описание
Fade ( AudioClip clip, float volume, bool loop ) : void

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 enalbed, fades in the specified clip as soon as it gets enabled.

Play ( ) : void

Continues fading in the current audio clip.

Stop ( ) : void

Stop playing the current audio clip immediately.

Приватные методы

Метод Описание
Awake ( ) : void
FadeToNextClip ( ) : void
OnDisable ( ) : void
OnEnable ( ) : void
Update ( ) : void

Описание методов

Fade() публичный Метод

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 enalbed, fades in the specified clip as soon as it gets enabled.
public Fade ( AudioClip clip, float volume, bool loop ) : void
clip UnityEngine.AudioClip Clip to fade in.
volume float Volume to fade to.
loop bool Whether to loop the new clip, or not.
Результат void

Play() публичный Метод

Continues fading in the current audio clip.
public Play ( ) : void
Результат void

Stop() публичный Метод

Stop playing the current audio clip immediately.
public Stop ( ) : void
Результат void

Описание свойств

FadeOutThreshold публичное свойство

Volume to end the previous clip at.
public float FadeOutThreshold
Результат float

FadeSpeed публичное свойство

Volume change per second when fading.
public float FadeSpeed
Результат float