Ejemplo n.º 1
0
 static public void RemoveParticleEffectInstance(MyParticleEffect effect)
 {
     effect.Close(false);
     //if (effect.Enabled)
     if (m_libraryEffects.ContainsKey(effect.GetID()))
     {
         var instances = m_libraryEffects[effect.GetID()].GetInstances();
         if (instances != null)
         {
             if (instances.Contains(effect))
             {
                 MyParticlesManager.EffectsPool.Deallocate(effect);
                 m_libraryEffects[effect.GetID()].RemoveInstance(effect);
             }
             else
             {
                 System.Diagnostics.Debug.Assert(false, "Effect deleted twice!");
             }
         }
     }
 }
        static public void RemoveParticleEffectInstance(MyParticleEffect effect)
        {
            effect.Close(false);
            //if (effect.Enabled)
            if (m_libraryEffects.ContainsKey(effect.GetID()))
            {
                var instances = m_libraryEffects[effect.GetID()].GetInstances();
                if (instances != null)
                {
                    if (instances.Contains(effect))
                    {
                        MyParticlesManager.EffectsPool.Deallocate(effect);
                        m_libraryEffects[effect.GetID()].RemoveInstance(effect);
                    }
                    else
                    {
                        System.Diagnostics.Debug.Assert(false, "Effect deleted twice!");

                    }
                }
            }
        }