Search Results for

    Show / Hide Table of Contents

    Class VolumeBinder

    Generic way to edit and bind the volume of a channel (AudioMixerGroup) to the local storage

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    VolumeBinder
    VolumeSlider
    Namespace: GGL.Audio
    Assembly: GGL.dll
    Syntax
    [HelpURL("https://ggl.yoannhaffner.com/articles/audio.html#interaction")]
    public class VolumeBinder : MonoBehaviour
    Examples

    VolumeSlider is a good example of what you can do.

    Fields

    | Edit this page View Source

    MAX_VOLUME

    Declaration
    protected const float MAX_VOLUME = 1
    Field Value
    Type Description
    float

    Maximal value used for setting volume.

    | Edit this page View Source

    MIN_VOLUME

    Declaration
    protected const float MIN_VOLUME = 0.0001
    Field Value
    Type Description
    float

    Minimal value used for setting volume.

    | Edit this page View Source

    channel

    Declaration
    [SerializeField]
    protected AudioChannel channel
    Field Value
    Type Description
    AudioChannel

    The channel to bind and edit.

    Properties

    | Edit this page View Source

    Value

    Declaration
    protected float Value { get; }
    Property Value
    Type Description
    float

    The current volume in range [0;1].

    Methods

    | Edit this page View Source

    Init()

    Read the local storage to initialize the channel volume. This method is called once the component is enabled.

    Declaration
    public virtual void Init()
    Remarks

    If not enabled, do not forget to call this method once the scene is loaded.

    | Edit this page View Source

    Set(float)

    Set a new volume to channel and local storage

    Declaration
    public virtual void Set(float value)
    Parameters
    Type Name Description
    float value

    Volume in range ]0;1]

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX