Пример #1
0
        public static Sound1D Create(string name, Cue cue, Action <string> onFinished)
        {
            Sound1D freshSound = Pool.Acquire <Sound1D>();

            freshSound.Name       = name;
            freshSound._cue       = cue;
            freshSound.OnFinished = onFinished;
            return(freshSound);
        }
Пример #2
0
 public void PlaySound(string soundName, bool force, Action <string> onFinished)
 {
     if (!_waveBank.IsPrepared || !_streamingBank.IsPrepared)
     {
         throw new InvalidOperationException("AudioManager is not prepared; update it some more.");
     }
     if (!IsPlaying(soundName) || force)
     {
         Sound1D freshSound = Sound1D.Create(soundName, _soundBank.GetCue(soundName), onFinished);
         freshSound.Play();
         _sounds.Add(freshSound);
     }
 }