if (audioManager.musicSound != null)
// if the music sound exists
// get the instance and start it
audioManager.musicSound = audioManager.soundBank[musicSoundName];
audioManager.musicSound.IsLooped = true;
The above methods allows playing and stopping one of the sounds loaded using the “LoadSounds” method. The final method enables support for background, and will not be used in the course of this exercise.
protected override void Dispose(bool disposing)
foreach (var item in soundBank)
soundBank = null;
The above method disposes of all sound instances created by the AudioManager.
Now that we have support for both animation and sound, we can revisit the various classes created during the previous tasks in order to enhance their functionality.
Page | 77