public void OnCollisionEnter(Collision collision) { spawnProjectile = collision.gameObject.GetComponentInChildren <SpawnProjectile>(); if (spawnProjectile != null) { spawnProjectile.SetBullets(5); } spawnProjectile.SetAmmoIconFalse(); spawnProjectile = null; }
private void OnTriggerEnter(Collider other) { FindObjectOfType <AudioManager>().Play("Recharge"); spawnProjectile = other.gameObject.GetComponentInChildren <SpawnProjectile>(); if (spawnProjectile != null) { spawnProjectile.SetBullets(5); } spawnProjectile.SetAmmoIconFalse(); spawnProjectile = null; }