Search Results for

    Show / Hide Table of Contents

    Class SoundPlayer

    A basic Singleton audio player to play sounds.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    SingletonBehaviour
    SingletonBehaviour<SoundPlayer>
    AbstractPlayer<SoundPlayer>
    SoundPlayer
    Inherited Members
    AbstractPlayer<SoundPlayer>.mixerGroup
    AbstractPlayer<SoundPlayer>.player
    AbstractPlayer<SoundPlayer>.Play(AudioClip, float)
    AbstractPlayer<SoundPlayer>.Stop()
    SingletonBehaviour<SoundPlayer>.Instance
    SingletonBehaviour<SoundPlayer>.Initialized
    Namespace: GGL.Audio.Player
    Assembly: GGL.dll
    Syntax
    [AddComponentMenu("GG-Library/Singletons/Audio/Sound Player")]
    [HelpURL("https://ggl.yoannhaffner.com/articles/audio.html#optimisation")]
    public class SoundPlayer : AbstractPlayer<SoundPlayer>

    Methods

    | Edit this page View Source

    PlayClip(AudioClip, float)

    Play an audio file on the Singleton audio player.

    Declaration
    protected override void PlayClip(AudioClip clip, float volume = 1)
    Parameters
    Type Name Description
    AudioClip clip

    Audio file to play.

    float volume

    Volume in range [0;1].

    Overrides
    AbstractPlayer<SoundPlayer>.PlayClip(AudioClip, float)
    | Edit this page View Source

    StopClip()

    Stop whatever is being played.

    Declaration
    protected override void StopClip()
    Overrides
    AbstractPlayer<SoundPlayer>.StopClip()
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX