soundmanager

SoundManager

SoundManager is your interface to using the audio features in Hard Times. You can call it to play ambient music or to play sounds that have been loaded via mod or internal sounds.


Contains a reference to the singleton instance. You can use it to call methods on the global object from any script:

SoundManager.instance.PlayButtonSound();

Contains a reference to the AudioSource attached to the camera and used to play music.

Contains a reference to the AudioSource attached to the camera and used to play audio fx.

Contains a reference to the AudioSource attached to the camera and used to play background ambient sounds.

Contains the actual global music volume value. It's value expressed in a range from 0 to 1.

SoundManager.instance.MusicVolume = 0.5f;

Contains the actual global audio fx volume value. It's value expressed in a range from 0 to 1.

SoundManager.instance.AudioVolume = 0.5f;

Immediately starts playing music from the AudioClip passed as a parameter

Immediately starts playing music searching from known audio files a file containing the name passed as a string.

Immediately stops any playing music.

Stops any playing music with a fadeout effect of the given length in seconds.

Starts playing the clip referred by the passed clip name as a string, with a fade in effect of the given length in seconds.

Immediately plays the passed AudioClip.

Immediately plays a file containing the name passed as a string, searched from known audio files.

A shortcut function which plays the default button sound.

A shortcut function which plays the default button sound.

Immediately stops any fx sound which may be playing.

Get a clip name in string format and returns an AudioClip, from the loaded clips.

You could leave a comment if you were logged in.
  • soundmanager.txt
  • Last modified: 2019/11/01 03:55
  • by thorfinio