Exemplo n.º 1
0
        /// <summary>
        /// Removes the sound emitter.
        /// </summary>
        /// <param name="em">The em.</param>
        public virtual void RemoveSoundEmitter(ISoundEmitter2D em)
        {
            if (em == null)
            {
                ActiveLogger.LogMessage("Emitter is Null " + em.ToString(), LogLevel.RecoverableError);
                return;
            }
            em.Stop();
            bool resp = SoundEmiters2D.Remove(em);

            if (!resp)
            {
                ActiveLogger.LogMessage("Emitter not found: " + em.ToString(), LogLevel.Warning);
            }
        }
Exemplo n.º 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(ISoundEmitter2D em, bool play = false)
        {
            if (em == null)
            {
                ActiveLogger.LogMessage("Emitter is Null " + em.ToString(), LogLevel.RecoverableError);
                return;
            }

            SoundEmiters2D.Add(em);
            em.Apply3D();
            if (play)
            {
                em.Play();
            }
        }