IEnumerator Reload() { uISingleton.setBullets("reloading"); yield return(new WaitForSeconds(2)); bulletsInMagazine = 10; magazines--; uISingleton.setBullets(bulletsInMagazine.ToString()); uISingleton.setMagazines(magazines.ToString()); canFire = true; }
// Start is called before the first frame update void Start() { uISingleton = UISingleton.Instance; uISingleton.setBullets(bulletsInMagazine.ToString()); uISingleton.setMagazines(magazines.ToString()); }
private void OnCollsionWithAmmo(Collision collision) { uISingleton.setMagazines(pistol.AddMagazine().ToString()); Destroy(collision.gameObject); }