In Unity3d
plane texture
To apply a sequence images, what should I do?
2 Answers
2Read the docs? (The second example does exactly what you want.)
var frames : Texture2D;
var framesPerSecond = 10.0;
function Update () {
var index : int = Time.time * framesPerSecond;
index = index % frames.Length;
renderer.material.mainTexture = frames[index];
}
Should open your followup as a new question. Resources.Load() will allow you to load images by name, but how you want to handle it will depend on the size of the images, the platform and the frame rate.
– robertbuThanks. I didn't want to start a new thread since multiple searches for what I wanted brought me here. I figure if other people are searching they to will find this topic and having the answer in the search result would be useful. So again thank you for the [Resource.Load()][1] answer [1]: http://docs.unity3d.com/Documentation/ScriptReference/Resources.Load.html
– Giantbean
Just following the docs for C# gives errors about .length (needs to be capitalized .Length) and errors about converting float to int
– Giantbean