Category5.SoundEffectEngine.Play C# (CSharp) Méthode

Play() public static méthode

public static Play ( string filename, Priority priority ) : void
filename string
priority Priority
Résultat void
        public static void Play(string filename, Priority priority)
        {
            if (filename != null && filename != "")
            {
                SoundClip newSound;
                switch (priority)
                {
                    case Priority.High:
                        newSound = new SoundClip(GameRef.Content, filename);
                        HighPrioritySounds.Add(newSound);
                        newSound.Play(volume, false);
                        break;
                    case Priority.Normal:
                        if (NormalSounds.Count < MaxNormalSounds)
                        {
                            newSound = new SoundClip(GameRef.Content, filename);
                            NormalSounds.Add(newSound);
                            newSound.Play(volume, false);
                        }
                        break;
                    case Priority.WindNoise:
                        newSound = new SoundClip(GameRef.Content, filename);
                        WindNoise = newSound;
                        newSound.Play(volume, true);
                        break;
                }
            }
            Update();
        }