コード例 #1
0
ファイル: ParticleManager.cs プロジェクト: fernung/Rysys
        public override void Update(GameTime gameTime)
        {
            int removal = 0;

            for (int i = 0; i < Particles.Count; i++)
            {
                var p = Particles[i];
                UpdateMethod(p);
                p.LifeTime -= 1.0f / p.Duration;

                ParticleContainer.Swap(Particles, i - removal, i);
                if (p.LifeTime < 0)
                {
                    removal++;
                }
            }
            Particles.Count -= removal;
        }