Search Results for

    Show / Hide Table of Contents

    Class MixerGroupFader

    Unity inspector class for pairing a with a parameter name for changing its volume.

    Inheritance
    Object
    MixerGroupFader
    Namespace: OmiyaGames.Audio
    Assembly: cs.temp.dll.dll
    Syntax
    public class MixerGroupFader
    Remarks

    The MIT License (MIT)

    Copyright (c) 2022 Omiya Games

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    RevisionDescription
    Version: 1.0.0
    Date: 6/26/2022
    Author: Taro Omiya
    Initial draft.

    Properties

    Group

    Gets this layer's .

    Declaration
    public AudioMixerGroup Group { get; }
    Property Value
    Type Description
    AudioMixerGroup

    ParamName

    Gets the Group's parameter name to adjust its volume.

    Declaration
    public string ParamName { get; }
    Property Value
    Type Description
    String

    Player

    The audio player currently playing on Group.

    Declaration
    public BackgroundAudio.Player Player { get; set; }
    Property Value
    Type Description
    BackgroundAudio.Player

    VolumePercent

    Sets the volume of Group.

    Declaration
    public float VolumePercent { get; set; }
    Property Value
    Type Description
    Single

    Methods

    GetFadeProgressionPercent()

    Calculates how far StartFadingVolume(Double, Double, Single, Action<MixerGroupFader>) progressed.

    Declaration
    public float GetFadeProgressionPercent()
    Returns
    Type Description
    Single

    The progress the fading coroutine hase made, as a percentage between 0 and 1.

    Setup(MonoBehaviour, AnimationCurve)

    Setup the member variables of this layer

    Declaration
    public void Setup(MonoBehaviour coroutineRunner, AnimationCurve percentToDbCurve)
    Parameters
    Type Name Description
    MonoBehaviour coroutineRunner

    The script to run coroutines like StartFadingVolume(Double, Double, Single, Action<MixerGroupFader>).

    AnimationCurve percentToDbCurve

    The curve used to convert a fraction from 0 to 1 to decibels.

    StartFadingVolume(Double, Double, Single, Action<MixerGroupFader>)

    Start the volume fading coroutine.

    Declaration
    public void StartFadingVolume(double startTime, double durationSeconds, float finalVolumePercent, Action<MixerGroupFader> afterFadeFinished = null)
    Parameters
    Type Name Description
    Double startTime

    The fading will start playing.

    Double durationSeconds

    The duration the fade will last, in seconds, normalised by .

    Single finalVolumePercent

    The volume to fade to.

    Action<MixerGroupFader> afterFadeFinished

    Invoked at the end of the . Argument is set to the source of this fade routine.

    StopFadingVolume()

    Stops the volume fading coroutine.

    Declaration
    public void StopFadingVolume()
    In This Article
    Back to top Copyright © 2022 Omiya Games