Following link says you can update texture sheet animation as below:
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void Start() {
ParticleSystem ps = GetComponent<ParticleSystem>();
var ts = ps.textureSheetAnimation;
ts.enabled = true;
ts.numTilesX = 2;
ts.useRandomRow = true;
}
}
However when you call “ps.textureSheetAnimation” it returns a struct. Updating variable ts changes only local copy. And ParticleSystem DOES NOT ALLOW you to set textureSheetAnimation again.
(unity 5.3.3.p1)
Edit: Please ignore this message. I decompiled and saw that stuct has reference to an object and each setter method modifies a variable in the referenced objects. A bad design pattern. Still I can not change the texture sheet frame over time; but it might be another problem
Edit2:
Okay problem solved:
tsa.frameOverTime = new ParticleSystem.MinMaxCurve(3f);
You needed to do
tsa.frameOverTime = new ParticleSystem.MinMaxCurve(3f / tsa.numTilesX);