var BulletSpawn : Transform;
var Bullet : GameObject;
var Ammo = 10;
function Start () {
}
function Update () {
if(Input.GetButtonDown(“Fire1”)){
animation.Play();
Instantiate(Bullet ,BulletSpawn.transform.position , BulletSpawn.transform.rotation);
Ammo --;
}
}
function OnGUI() {
GUI.Label(Rect (10, 10, 100, 20), "Ammo : " + Ammo);