function Start () {
// Select the first weapon
SelectWeapon(0);
}
function Update () {
// Did the user press fire?
if (Input.GetButton ("Fire1"))
BroadcastMessage("Fire");
if (Input.GetKeyDown("1")) {
SelectWeapon(0);
}
else if (Input.GetKeyDown("2")) {
SelectWeapon(1);
}
else if (Input.GetKeyDown("3")) {
if (gameObject("AssultRifle").SetActiveRecursively(true));{
SelectWeapon(2);
}
else if (gameObject("AssultRifle").SetActiveRecursively(false));{
SelectWeapon(null);
}
}