texture tiling and animation problem

After reading several post on texture applications from blender
I found my problems had to do with uv mapping in blender and then reimporting the model into unity. i used the script from the wiki to animate and tile
the textures (tank Treads)and they work fine. Now my question is how do i stop the animation when the model is sitting still?

here is the code from the wiki

var uvAnimationTileX = 24; //Here you can place the number of columns of your sheet.
//The above sheet has 24

var uvAnimationTileY = 1; //Here you can place the number of rows of your sheet.
//The above sheet has 1
var framesPerSecond = 10.0;

function Update () {

// Calculate index
var index : int = Time.time * framesPerSecond;
// repeat when exhausting all frames
index = index % (uvAnimationTileX * uvAnimationTileY);

// Size of every tile
var size = Vector2 (1.0 / uvAnimationTileX, 1.0 / uvAnimationTileY);

// split into horizontal and vertical index
var uIndex = index % uvAnimationTileX;
var vIndex = index / uvAnimationTileX;

// build offset
// v coordinate is the bottom of the image in opengl so we need to invert.
var offset = Vector2 (uIndex * size.x, 1.0 - size.y - vIndex * size.y);

renderer.material.SetTextureOffset ("_MainTex", offset);
renderer.material.SetTextureScale ("_MainTex", size);

}

thanks

wayne

To stop the animation, make the index a global variable and just don’t recalculate it in the update.

var Playing : boolean = true;    //Change this to false to stop the animation
var index : int;    //The frame of the animation

function Update () {
if (Playing)
{
    // Calculate index
    index = Time.time * framesPerSecond;
    // repeat when exhausting all frames
    index = index % (uvAnimationTileX * uvAnimationTileY);
}
...