Corgi Engine  v8.8
MoreMountains.CorgiEngine.BackgroundMusic Class Reference

Add this class to a GameObject to have it play a background music when instanciated. Careful : only one background music will be played at a time. More...

Inheritance diagram for MoreMountains.CorgiEngine.BackgroundMusic:
MoreMountains.Tools.MMPersistentHumbleSingleton< BackgroundMusic >

Public Attributes

AudioClip SoundClip
 the background music audio clip to play More...
 
bool Loop = true
 whether or not the music should loop More...
 
int ID = 255
 the ID to create this background music with More...
 
- Public Attributes inherited from MoreMountains.Tools.MMPersistentHumbleSingleton< BackgroundMusic >
float InitializationTime
 the timestamp at which this singleton got initialized More...
 

Protected Member Functions

virtual void Start ()
 Gets the AudioSource associated to that GameObject, and asks the GameManager to play it. More...
 
- Protected Member Functions inherited from MoreMountains.Tools.MMPersistentHumbleSingleton< BackgroundMusic >
virtual void Awake ()
 On awake, we check if there's already a copy of the object in the scene. If there's one, we destroy it. More...
 
virtual void InitializeSingleton ()
 Initializes the singleton. More...
 

Static Protected Member Functions

static void InitializeStatics ()
 Statics initialization to support enter play modes More...
 

Protected Attributes

AudioSource _source
 

Additional Inherited Members

- Static Public Attributes inherited from MoreMountains.Tools.MMPersistentHumbleSingleton< BackgroundMusic >
static bool HasInstance
 whether or not this singleton already has an instance More...
 
static T Current
 
- Static Protected Attributes inherited from MoreMountains.Tools.MMPersistentHumbleSingleton< BackgroundMusic >
static T _instance
 
- Properties inherited from MoreMountains.Tools.MMPersistentHumbleSingleton< BackgroundMusic >
static T Instance [get]
 Singleton design pattern More...
 

Detailed Description

Add this class to a GameObject to have it play a background music when instanciated. Careful : only one background music will be played at a time.

Member Function Documentation

◆ InitializeStatics()

static void MoreMountains.CorgiEngine.BackgroundMusic.InitializeStatics ( )
staticprotected

Statics initialization to support enter play modes

◆ Start()

virtual void MoreMountains.CorgiEngine.BackgroundMusic.Start ( )
protectedvirtual

Gets the AudioSource associated to that GameObject, and asks the GameManager to play it.

Member Data Documentation

◆ _source

AudioSource MoreMountains.CorgiEngine.BackgroundMusic._source
protected

◆ ID

int MoreMountains.CorgiEngine.BackgroundMusic.ID = 255

the ID to create this background music with

◆ Loop

bool MoreMountains.CorgiEngine.BackgroundMusic.Loop = true

whether or not the music should loop

◆ SoundClip

AudioClip MoreMountains.CorgiEngine.BackgroundMusic.SoundClip

the background music audio clip to play


The documentation for this class was generated from the following file: