var clips : AudioClip[];
var trigger : String = "Fire1";
var playOnCollision : boolean = false;
private var timeSinceStep : float = 0.0;
private var isFoot; 
isFoot = (gameObject.name == "L_Ankle" || gameObject.name == "R_Ankle");

function Update () {
	/*if(isFoot){
		if(Input.GetAxis("Horizontal") || Input.GetAxis("Vertical")){
			if(timeSinceStep <= 0){
				PlayRandom();
				timeSinceStep = GameObject.FindWithTag("Player").GetComponent("MouseAnimation").stepTime;
			} else {
				timeSinceStep -= Time.deltaTime;
			}
		} else {
			timeSinceStep = 0;
		}
	}*/
	if(trigger == "-1"){
		//no trigger
	} else if(Input.GetButtonDown(trigger)){
		PlayRandom();
	}
}

function PlayRandom(){
	if(clips){
		var theIndex : float = Random.Range(0, clips.length);
		audio.clip = clips[theIndex];
	}
	audio.Play();
}

function OnCollisionEnter(col : Collision) {
	if(playOnCollision){
		PlayRandom();
	}
}

function OnTriggerEnter(col : Collider) {
	if(playOnCollision){
		PlayRandom();
	}
}

@script RequireComponent(AudioSource)