weapon animation question

How can I associate animations to weapons? I made animations like switching weapon and bobbing weapon, but I can not associate the weapon switching animation to the key 2, or the bobbing animation to the ASD keys. Could someone tell me how could I do that ?

como posso criar associar animações em armas por exemplo eu fiz varias animaçoes a arma a trocar e a arma a mexer mas não sei associar a animação de trocar de arma a tecla 2 e a arma a mexer ás teclas a s d, someone could tell me how i do that?

So all you want is a Weapon Switching script ??? if so then this should do

function Start()

{
SwitchWeapon(0);
}

function Update ()
{
if(Input.GetKeyDown(“1”))

{
	SwitchWeapon (0);
}

else if(Input.GetKeyDown("2"))

{
	SwitchWeapon (1);
}
else if(Input.GetKeyDown("3"))

{
	SwitchWeapon (2);
}

}

function SwitchWeapon(index : int)

{
		for( var i = 0; i<transform.childCount; i ++)
{
	if(i == index)
{
		transform.GetChild(i).gameObject.SetActiveRecursively(true);
}
		else transform.GetChild(i).gameObject.SetActiveRecursively(false);
}

}