I am trying to access the shurikan particle system’s ‘texture sheet animation’ via script. From the Unity manual at Unity - Scripting API: ParticleSystem.textureSheetAnimation , when I copy the code 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;
}
}
Unity produces an error:
Assets/SetParticleTexture.cs(51,29): error CS1061: Type UnityEngine.ParticleSystem' does not contain a definition for
textureSheetAnimation’ and no extension method textureSheetAnimation' of type
UnityEngine.ParticleSystem’ could be found (are you missing a using directive or an assembly reference?)
I am not sure why this is… it doesn’t produce a similar error if I, for example, address ParticleSystem.startRotation. Has anyone tried accessing textureSheetAnimation from script or know what I might be missing here?
Thanks for reading!