void Start() { g = gun.GetComponent <gun>(); ammo = g.getAmmo(); //healthBar = GameObject.Find("Ammunition").GetComponent<HealthBarController>(); t = GetComponent <Text>(); }
// Update is called once per frame void Update() { ammo = g.getAmmo(); t.text = ammo.ToString(); }
// Update is called once per frame void Update() { ammo = g.getAmmo(); bar.value = ammo; }