// Update is called once per frame void Update() { if (myScreenAmmo.tag == "CurrentAmmoScreen") { myScreenAmmo.text = "Ammo: " + ammoManager.GetCurrentAmmo(); } }
public void shootBullet() { if (!hasInfiniteAmmo) { if (canShoot && ammoManager.GetCurrentAmmo() >= 1) { Instantiate(bullet, firePoint.position, firePoint.rotation); canShoot = false; StartCoroutine(Delay()); ammoManager.DecraseAmmo(1); } } else if (canShoot) { Instantiate(bullet, firePoint.position, firePoint.rotation); canShoot = false; StartCoroutine(Delay()); } }