added music functionality

This commit is contained in:
linuxfight 2023-08-15 18:52:35 +03:00
parent 06d54653c3
commit e2f40e86ad

View file

@ -24,10 +24,12 @@ namespace DangerousD.GameCore
}
}
public void StartSound(string soundName) // запустить звук у которого нет позиции
public void StartSound(string soundName, bool isMusic) // запустить звук у которого нет позиции
{
var sound = new Sound(Sounds[soundName]);
sound.SoundEffect.IsLooped = false;
if (isMusic)
sound.SoundEffect.IsLooped = true;
sound.SoundEffect.Play();
PlayingSounds.Add(sound);
}