I would like to set Particle System TextureSheetAnimationModule.rowIndex. Here's the code based on Unity reference (https://docs.unity3d.com/ScriptReference/ParticleSystem.TextureSheetAnimationModule-rowIndex.html):
ParticleSystem ps = particleEffect.GetComponent();
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.
↧