public void Update()
 {
     if (m_particleId < 0)
     {
         return;
     }
     if (m_effect == null || m_effect.IsStopped)
     {
         if (m_playedOnce && m_loop == false)
         {
             m_canBeDeleted = true;
         }
         else
         {
             if (m_timer > 0f)
             {
                 m_timer -= MyEngineConstants.UPDATE_STEP_SIZE_IN_SECONDS;
             }
             else
             {
                 m_playedOnce   = true;
                 m_canBeDeleted = !MyParticlesManager.TryCreateParticleEffect(m_particleId, out m_effect);
                 if (m_effect != null)
                 {
                     m_effect.WorldMatrix = m_entity.WorldMatrix;
                 }
                 if (m_spawnTimeMax > 0f)
                 {
                     m_timer = MyUtils.GetRandomFloat(m_spawnTimeMin, m_spawnTimeMax);
                 }
                 else
                 {
                     m_timer = 0;
                 }
             }
         }
     }
     else
     {
         if (m_effect != null)
         {
             float time = m_effect.GetElapsedTime();
             if (m_duration > 0f && time >= m_duration)
             {
                 m_effect.Stop();
             }
             else
             {
                 if (m_originPoint != null)
                 {
                     m_effect.WorldMatrix = MatrixD.Multiply(MatrixD.Normalize(m_originPoint.Matrix), m_entity.WorldMatrix);
                 }
                 else
                 {
                     m_effect.WorldMatrix = m_entity.WorldMatrix;
                 }
             }
         }
     }
 }