TopDown Engine  v3.6
MoreMountains.TopDownEngine.PersistentBackgroundMusic 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.TopDownEngine.PersistentBackgroundMusic:
MoreMountains.Tools.MMPersistentSingleton< PersistentBackgroundMusic >

Public Attributes

AudioClip SoundClip
 the background music clip to use as persistent background music More...
 
bool Loop = true
 whether or not the music should loop More...
 
- Public Attributes inherited from MoreMountains.Tools.MMPersistentSingleton< PersistentBackgroundMusic >
bool AutomaticallyUnparentOnAwake
 if this is true, this singleton will auto detach if it finds itself parented on awake More...
 

Protected Member Functions

virtual void OnEnable ()
 
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.MMPersistentSingleton< PersistentBackgroundMusic >
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...
 

Protected Attributes

AudioSource _source
 
PersistentBackgroundMusic _otherBackgroundMusic
 
- Protected Attributes inherited from MoreMountains.Tools.MMPersistentSingleton< PersistentBackgroundMusic >
bool _enabled
 

Additional Inherited Members

- Static Public Attributes inherited from MoreMountains.Tools.MMPersistentSingleton< PersistentBackgroundMusic >
static bool HasInstance
 
static T Current
 
- Static Protected Attributes inherited from MoreMountains.Tools.MMPersistentSingleton< PersistentBackgroundMusic >
static T _instance
 
- Properties inherited from MoreMountains.Tools.MMPersistentSingleton< PersistentBackgroundMusic >
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

◆ OnEnable()

virtual void MoreMountains.TopDownEngine.PersistentBackgroundMusic.OnEnable ( )
protectedvirtual

◆ Start()

virtual void MoreMountains.TopDownEngine.PersistentBackgroundMusic.Start ( )
protectedvirtual

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

Member Data Documentation

◆ _otherBackgroundMusic

PersistentBackgroundMusic MoreMountains.TopDownEngine.PersistentBackgroundMusic._otherBackgroundMusic
protected

◆ _source

AudioSource MoreMountains.TopDownEngine.PersistentBackgroundMusic._source
protected

◆ Loop

bool MoreMountains.TopDownEngine.PersistentBackgroundMusic.Loop = true

whether or not the music should loop

◆ SoundClip

AudioClip MoreMountains.TopDownEngine.PersistentBackgroundMusic.SoundClip

the background music clip to use as persistent background music


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