Example #1
0
        IEnumerator CoPlayRepeat()
        {
            var sfxChannel = new SoundChannel();
            var snd        = new SoundEffect("coin.opus");

            // make sure these get disposed
            this.AddMany(sfxChannel, snd);

            while (true)
            {
                // play a sound effect every 3 seconds
                yield return(WaitFor.Seconds(3));

                sfxChannel.PlaySound(snd);
            }
        }