// Update is called once per frame void Update() { int count = particles.Count; for (int i = 0; i < count; i++) { if (particles[i] != null) { for (int j = i + 1; j < count; j++) { if (particles[j] != null) //DeleteParticle(particles[j]); //else { if (CollisonDetector.DetectCollision(particles[i], particles[j])) { HandlePlanetaryCollision(particles[i], particles[j]); AddStyleToCollision(particles[i], particles[j]); } } } } //else //DeleteParticle(particles[i]); } ClearOutDeadParticles(); }
// Update is called once per frame void Update() { for (int i = 0; i < particles.Count; i++) { if (particles[i] != null) { for (int j = i + 1; j < particles.Count; j++) { if (particles[j] != null) //DeleteParticle(particles[j]); //else { if (CollisonDetector.DetectCollision(particles[i], particles[j])) { particlesToDelete.Add(particles[i]); particlesToDelete.Add(particles[j]); } } } } //else //DeleteParticle(particles[i]); } ClearOutDeadParticles(); }