Class MixerGroupManager
Manager for
Namespace: OmiyaGames.Audio
Assembly: cs.temp.dll.dll
Syntax
public class MixerGroupManager
Remarks
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.
Revision | Description |
---|---|
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 |
MixerGroupFader[] | fadeLayers | Pairs of |
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 |
Returns
Type | Description |
---|---|
Boolean | true if fading has been performed; false otherwise. |
GetManagedPlayers()
Gets a list of BackgroundAudio.Players that's
playing on a
Declaration
public BackgroundAudio.Player[] GetManagedPlayers()
Returns
Type | Description |
---|---|
BackgroundAudio.Player[] | The list of BackgroundAudio.Players managed by this instance. |
GetMixerGroup(Int32)
Gets the
Declaration
public AudioMixerGroup GetMixerGroup(int layerIndex)
Parameters
Type | Name | Description |
---|---|---|
Int32 | layerIndex | Index corresponding to the list in Unity Project Settings
dialog (starting at |
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 |
Returns
Type | Description |
---|---|
Single | The volume, as a fraction between |
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 |
Single | volumePercent | The volume, as a fraction between |