Пример #1
0
        /// <summary>
        /// Removes the sound emitter.
        /// </summary>
        /// <param name="em">The em.</param>
        public virtual void RemoveSoundEmitter(ISoundEmitter3D em)
        {
            if (em == null)
            {
                ActiveLogger.LogMessage("Emitter is Null " + em.ToString(), LogLevel.RecoverableError);
                return;
            }
            em.Stop();
            bool resp = SoundEmiters3D.Remove(em);
            if (!resp)
            {
                ActiveLogger.LogMessage("Emitter not found: " + em.ToString(), LogLevel.Warning);
            }

        }
Пример #2
0
 /// <summary>
 /// Adds the sound emitter.
 /// </summary>
 /// <param name="em">The em.</param>
 /// <param name="play">if set to <c>true</c> [play].</param>
 public virtual void AddSoundEmitter(ISoundEmitter3D em, bool play = false)
 {
     if (em == null)
     {
         ActiveLogger.LogMessage("Emitter is Null " + em.ToString(), LogLevel.RecoverableError);
         return;
     }
     
     SoundEmiters3D.Add(em);
     em.Apply3D();
     if(play)
         em.Play();
 }