Is it possible to count Random.range animation playback??

Is there a way to count actual specific animation playback? Adding Count+1; the counter just adds and climbs as fast as the random generates, not timed with the animation actually playing. Any scripts, ideas, links will be much appreciated at this stage.Thankyou all.

#pragma strict

var Anims = ["up","down"];
var Model: GameObject;



function Update () {

}
Game();
}



function Game () {


var random:int = Random.Range(0,2);


if (random ==0){

animation.PlayQueued("up");

}

if (random ==1){

animation.PlayQueued("down");

}

}

You could use Animation Events and a script like this. Make an animation even trigger “DoneAnimating”

#pragma strict
var Anims = ["up","down"];
var Model: GameObject;
var animating : System.Boolean;

function Update () 
{
 	Game();
}
 
function Game ()
{
	if (!animating)
	{
		var random:int = Random.Range(0,2);
		 
		if (random == 0)
		{
			animation.PlayQueued("up");
			animating = true;
		}
		else if (random == 1)
		{
			animation.PlayQueued("down");
			animating = true;
		}
	}
}

function DoneAnimating()
{
	animating = false;
}