Add() static private method

Add the specified instance to the pool if it is a pooled instance and removes it from the list of playing instances.
static private Add ( SoundEffectInstance inst ) : void
inst SoundEffectInstance The SoundEffectInstance
return void
コード例 #1
0
 private void PlatformStop(bool immediate)
 {
     if (_source)
     {
         _source.Stop();
         pool.Restore(_source);
         _source = null;
         SoundEffectInstancePool.Add(this);
     }
 }
コード例 #2
0
        /// <summary>
        /// Stops playing the DynamicSoundEffectInstance.
        /// If the <paramref name="immediate"/> parameter is false, this call has no effect.
        /// </summary>
        /// <remarks>
        /// Calling this also releases all queued buffers.
        /// </remarks>
        /// <param name="immediate">When set to false, this call has no effect.</param>
        public override void Stop(bool immediate)
        {
            AssertNotDisposed();

            if (immediate)
            {
                DynamicSoundEffectInstanceManager.RemoveInstance(this);

                PlatformStop();
                _state = SoundState.Stopped;

                SoundEffectInstancePool.Add(this);
            }
        }