Hi,
As yet I dont have the PRO version (although Im counting my pennies)
I need to use a short movie in my game demo, but cant yet use movie import… but I found a hack.
if I exprt my movie(tis but 50 frames) as seperate frames pngs, and then use THIS…
// Assign the texture exposed in the inspector the renderer's material
var texture : Texture;
renderer.material.mainTexture = texture;
// Change renderer's texture each changeInterval
// seconds from the texture array defined in the inspector.
var textures : Texture[];
var changeInterval = 0.33;
function Update() {
if( textures.length == 0 ) // nothing if no textures
return;
// we want this texture index now
var index : int = Time.time / changeInterval;
// take a modulo with size so that animation repeats
index = index % textures.length;
// assign it
renderer.material.mainTexture = textures[index];
}
to change the texture on a plane… i can get a small movie to run (not how I cleverly commented out one line to stop it from looping.
HOWEVER, using this method I have to define the number of elements, and then drag in EVERY frame to the Element slots.
OW!!!
Isnt it a peice of cake for a clever programmer type (not me) to do something like this where it can simply update the name of the texture used from Frame0001 to Frame0002, Frame0003.
can some nice person help me with the code for that?
Mark