Templates & Examples

Built in templates in Sonity which you can use as a starting point

Sonity contains examples and script templates of advanced functionality which you can use in your game.

Example_AudioMixer.mixer

Is an example AudioMixer with groups such as Example_AMB, Example_MUS, Example_SFX, Example_UI and Example_VO.

TemplateSoundMusicManager.cs

Template of a singleton music playback system. Add to a GameObject in the scene and use like this:

SonityTemplate.TemplateSoundMusicManager.Instance.PlayMainMenu();

TemplateSoundPlayUI.cs

Template of a singleton used to play e.g. UI sounds. Useful when you want to play SoundEvents in a lot of places through code. Add to a GameObject in the scene and use like this:

SonityTemplate.TemplateSoundPlayUI.Instance.PlayButtonClick();

TemplateSoundVolumeManager.cs

Template of a singleton AudioMixer volume controller. The default settings work with the provided "Example_AudioMixer.mixer". Add to a GameObject in the scene and use like this:

SonityTemplate.TemplateSoundVolumeManager.Instance.SetVolumeMaster(1f);

Last updated