Search Results for

    Show / Hide Table of Contents

    Class MixerGroupManager

    Manager for , used to fade in and out various BackgroundAudio.Players.

    Inheritance
    Object
    MixerGroupManager
    Namespace: OmiyaGames.Audio
    Assembly: cs.temp.dll.dll
    Syntax
    public class MixerGroupManager
    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: 5/23/2022
    Author: Taro Omiya
    Initial draft.

    Constructors

    MixerGroupManager(AudioPlayerManager, AnimationCurve, MixerGroupFader[])

    Constructs a new manager.

    Declaration
    public MixerGroupManager(AudioPlayerManager manager, AnimationCurve percentToDbCurve, MixerGroupFader[] fadeLayers)
    Parameters
    Type Name Description
    AudioPlayerManager manager

    The manager for BackgroundAudio.Players.

    AnimationCurve percentToDbCurve

    Curve used to convert a fraction from 0 to 1 to decibels.

    MixerGroupFader[] fadeLayers

    Pairs of and parameter name for the group's volume.

    Methods

    FadeIn(BackgroundAudio.Player, FadeInArgs)

    Starts playing the player, and fading it in to full volume.

    Declaration
    public bool FadeIn(BackgroundAudio.Player player, FadeInArgs args)
    Parameters
    Type Name Description
    BackgroundAudio.Player player

    The BackgroundAudio.Player to start playing, and/or fading in.

    FadeInArgs args

    Details on how to fade, e.g. how long it should last, etc.

    Returns
    Type Description
    Boolean

    true if fading has been performed; false otherwise.

    FadeOut(BackgroundAudio.Player, FadeOutArgs)

    Fades out a player, and optinally stop playing once it's silent.

    Declaration
    public bool FadeOut(BackgroundAudio.Player player, FadeOutArgs args)
    Parameters
    Type Name Description
    BackgroundAudio.Player player

    The BackgroundAudio.Player to fade out, and/or stop.

    FadeOutArgs args

    Details on how to fade out, e.g. how long it should last, etc.

    Returns
    Type Description
    Boolean

    true if fading has been performed; false otherwise.

    FadeTo(BackgroundAudio.Player, FadeInArgs, Single)

    Starts playing the player, and fading it in to the specified volume.

    Declaration
    public bool FadeTo(BackgroundAudio.Player player, FadeInArgs args, float finalVolumePercent)
    Parameters
    Type Name Description
    BackgroundAudio.Player player

    The BackgroundAudio.Player to start playing, and/or fading in.

    FadeInArgs args

    Details on how to fade, e.g. how long it should last, etc.

    Single finalVolumePercent

    The final volume at the end of the fade, as a fraction between 0 and 1.

    Returns
    Type Description
    Boolean

    true if fading has been performed; false otherwise.

    GetManagedPlayers()

    Gets a list of BackgroundAudio.Players that's playing on a managed by this manager.

    Declaration
    public BackgroundAudio.Player[] GetManagedPlayers()
    Returns
    Type Description
    BackgroundAudio.Player[]

    The list of BackgroundAudio.Players managed by this instance.

    GetMixerGroup(Int32)

    Gets the at a specified index.

    Declaration
    public AudioMixerGroup GetMixerGroup(int layerIndex)
    Parameters
    Type Name Description
    Int32 layerIndex

    Index corresponding to the list in Unity Project Settings dialog (starting at 0.)

    Returns
    Type Description
    AudioMixerGroup

    The corresponding .

    GetVolume(Int32)

    Gets the volume for a .

    Declaration
    public float GetVolume(int layerIndex)
    Parameters
    Type Name Description
    Int32 layerIndex

    Index corresponding to the list in Unity Project Settings dialog (starting at 0.)

    Returns
    Type Description
    Single

    The volume, as a fraction between 0 and 1.

    SetVolume(Int32, Single)

    Sets the volume for a .

    Declaration
    public void SetVolume(int layerIndex, float volumePercent)
    Parameters
    Type Name Description
    Int32 layerIndex

    Index corresponding to the list in Unity Project Settings dialog (starting at 0.)

    Single volumePercent

    The volume, as a fraction between 0 and 1.

    In This Article
    Back to top Copyright © 2022 Omiya Games