I would like to set Particle System TextureSheetAnimationModule.rowIndex. Here’s the code based on Unity reference (Unity - Scripting API: ParticleSystem.TextureSheetAnimationModule.rowIndex):
ParticleSystem ps = particleEffect.GetComponent<ParticleSystem>();
ParticleSystem.TextureSheetAnimationModule tex = ps.textureSheetAnimation;
tex.rowIndex = 2;
It doesn’t work and generates this error:
NullReferenceException: Do not create your own module instances, get them from a ParticleSystem instance UnityEngine.ParticleSystem+TextureSheetAnimationModule.set_rowIndex (Int32 value)
Am I doing something wrong or is Unity reference out of date? I have Unity 5.5.2f1.