Stop audio on close

This commit is contained in:
Alessandro Proto 2023-02-12 09:49:58 +01:00
parent d318523bde
commit 5dddc42910

View file

@ -14,6 +14,7 @@ public class Audio : IPlugin
public Audio(IGame game) public Audio(IGame game)
{ {
_game = game; _game = game;
_game.EventEmitter.OnClose += OnClose;
} }
private static LuaRegister[] AudioLib = new LuaRegister[] private static LuaRegister[] AudioLib = new LuaRegister[]
@ -214,4 +215,9 @@ public class Audio : IPlugin
return 1; return 1;
} }
private void OnClose(object sender, EventArgs e)
{
_game.Audio.Sound.Stop(true);
}
} }