ParticleSystem does not contain a definition for minEmission error

Hi I fixed a lot of my compile errors but this one I don’t understand. I changed ParticleEmission to ParticleSystem to fix the compile error, and then it said ParticleSystem doesnt contain a definition for minEmission.

error CS1061: Type UnityEngine.ParticleSystem' does not contain a definition for minEmission’ and no extension method minEmission' of type UnityEngine.ParticleSystem’ could be found. Are you missing an assembly reference?

meshParticles.transform.GetChild (0).GetComponent<ParticleSystem> ().minEmission = laserDistance * 3;
meshParticles.transform.GetChild (0).GetComponent<ParticleSystem> ().maxEmission = laserDistance * 3;

It looks like minEmission is now deprecated… Perhaps this could help?


Yes that helps, thanks.
That doesnt mention about the min and max emission though. Would that be set using ParticleSystem.Burst(); ?

I think I fixed it. Does this look right?

ParticleSystem ps = GetComponent<ParticleSystem> ();
				var em = ps.emission;

				em.enabled = true;
					new ParticleSystem.Burst[]{
						new ParticleSystem.Burst(laserDistance * 3, 100),
						new ParticleSystem.Burst(laserDistance * 3, 100)