mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-11-15 11:22:55 +00:00
Merge pull request #782 from FunkinCrew/cyn0x8/funkinsound-persist
[PUBLIC PR] If FunkinSound.persist is true, don't destroy it when switching states
This commit is contained in:
commit
5c6d72d8d5
|
@ -550,11 +550,12 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
|
|||
/**
|
||||
* Stop all sounds in the pool and allow them to be recycled.
|
||||
*/
|
||||
public static function stopAllAudio(musicToo:Bool = false):Void
|
||||
public static function stopAllAudio(musicToo:Bool = false, persistToo:Bool = false):Void
|
||||
{
|
||||
for (sound in pool)
|
||||
{
|
||||
if (sound == null) continue;
|
||||
if (!persistToo && sound.persist) continue;
|
||||
if (!musicToo && sound == FlxG.sound.music) continue;
|
||||
sound.destroy();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue