I am following the example here Unity - Scripting API: ParticleSystem.GetParticles but my loop seems to be playing more times than given by the relevant variable. As you can see from the screenshot below numParticlesAlive has a value of 2 but the loop was executed 18 times instead, any clues?
void CreateList(){
int numParticlesAlive = m_System.GetParticles(m_Particles);
print (numParticlesAlive);
for (int i = 0; i < numParticlesAlive; i++) {
particlePosition = m_Particles[i].position;
particleList.Add(particlePosition);
print(particleList[i]);
}
}