public virtual void Play(SoundConfiguration configurations)
    {
        if (configurations != null)
        {
            volume      = configurations.volume < 0 ? volume:configurations.volume;
            fadeInTime  = configurations.fadeInTime < 0 ? fadeInTime:configurations.fadeInTime;
            fadeOutTime = configurations.fadeOutTime < 0 ? fadeOutTime:configurations.fadeOutTime;

            if (configurations.loopHasChanged())
            {
                isLoop = configurations.getLoopValue();
            }
        }

        PlayRandomClip(true);
    }
Beispiel #2
0
    /**
     * Starts playing the first clip.
     **/
    override public void Play(SoundConfiguration configurations)
    {
        if (isEmpty())
        {
            //nothing to play
            Debug.LogWarning("There is no AudioClip on: " + soundName + " to play.");
            return;
        }

        if (configurations != null)
        {
            volume      = configurations.volume < 0 ? volume:configurations.volume;
            fadeInTime  = configurations.fadeInTime < 0 ? fadeInTime:configurations.fadeInTime;
            fadeOutTime = configurations.fadeOutTime < 0 ? fadeOutTime:configurations.fadeOutTime;

            if (configurations.loopHasChanged())
            {
                isLoop = configurations.getLoopValue();
            }
        }

        PlayClipAt(0, true);
    }