using UnityEngine; public class Gun : MonoBehaviour { public GameObject bulletPrefab; public Transform spawnPoint; void Start() { } void Update() { } public void Shoot() { if (GameManager.gameManager.gameRunning)Instantiate(bulletPrefab, spawnPoint.position, spawnPoint.rotation); } }