| 12345678910111213141516171819202122 |
- 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);
- }
- }
|