texture offset and timing (slideshow effect)

Hi,

I'm trying to make a script to offset textures. I don't really need it to move, I need more of a slideshow effect, kind of where it just "pops" to the next frame.

I thought of laying out the pictures all next to each other and then just using a script such as the one described here to offset the texture.

How can I get it to wait a second or something, and then just move it to the next frame?

Here's what I'm trying:

var scrollspeed : float;

function Update () {

    yield WaitForSeconds (2);
    renderer.material.SetTextureOffset("_MainTex", Vector2(.5, 0));

}

Thanks in advance.

You can't yield the update function, it has to run every frame.

Make a new function called slideShow with the yield or use a time stamp on the update function or invoke repeating

e.g.

function Start(){
  StartSlideShow(2);
}

function StartSlideShow(time : float){
  While(true){ // infinite loop
     // move texture
     renderer.material.SetTextureOffset("_MainTex", Vector2(.5, 0));
     yield WaitForSeconds(time);
  }
}