1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-23 05:37:38 +00:00

Merge pull request #646 from FunkinCrew/gamerbross/playonce-returns

[PUBLIC PR] FunkinSound.playOnce now returns the created sound
This commit is contained in:
Cameron Taylor 2024-07-04 15:10:20 -04:00 committed by GitHub
commit 6593ddbbc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -535,11 +535,12 @@ class FunkinSound extends FlxSound implements ICloneable<FunkinSound>
* Play a sound effect once, then destroy it.
* @param key
* @param volume
* @return static function construct():FunkinSound
* @return A `FunkinSound` object, or `null` if the sound could not be loaded.
*/
public static function playOnce(key:String, volume:Float = 1.0, ?onComplete:Void->Void, ?onLoad:Void->Void):Void
public static function playOnce(key:String, volume:Float = 1.0, ?onComplete:Void->Void, ?onLoad:Void->Void):Null<FunkinSound>
{
var result = FunkinSound.load(key, volume, false, true, true, onComplete, onLoad);
return result;
}
/**