play() public method

public play ( bool ForceRestart = false ) : void
ForceRestart bool
return void
示例#1
0
        static private FlxSound loadSound(SoundEffect EmbeddedSound, float Volume, bool Looped, bool AutoDestroy, bool AutoPlay)
        {
            if (EmbeddedSound == null)
            {
                FlxG.log("WARNING: FlxG.loadSound() requires an embedded sound to work.");
                return(null);
            }
            FlxSound sound = new FlxSound();

            if (EmbeddedSound != null)
            {
                sound.loadEmbedded(EmbeddedSound, Looped, AutoDestroy);
            }
            sound.volume = Volume;
            if (AutoPlay)
            {
                sound.play();
            }
            return(sound);
        }
示例#2
0
 private static FlxSound loadSound(SoundEffect EmbeddedSound, float Volume, bool Looped, bool AutoDestroy, bool AutoPlay)
 {
     if (EmbeddedSound == null)
     {
         FlxG.log("WARNING: FlxG.loadSound() requires an embedded sound to work.");
         return null;
     }
     FlxSound sound = new FlxSound();
     if (EmbeddedSound != null)
         sound.loadEmbedded(EmbeddedSound, Looped, AutoDestroy);
     sound.volume = Volume;
     if (AutoPlay)
         sound.play();
     return sound;
 }