# Conflicts:
#	Assets/Scenes/Story1.unity
#	Assets/Scripts/Shoot.cs
This commit is contained in:
2026-08-20 11:11:28 +02:00
9 changed files with 151 additions and 163 deletions
+18
View File
@@ -6,19 +6,35 @@ public class Shoot : MonoBehaviour
[SerializeField] GameObject bulletPrefab;
[SerializeField] Transform spawnPointAR;
[SerializeField] Transform spawnPointPistol;
[SerializeField] WeaponReload weapon;
[SerializeField] float fireRate = 0.15f;
[SerializeField] bool AR = true;
[SerializeField] bool Pistole = true;
private float nextShotTime;
void Start()
{
<<<<<<< HEAD
=======
if (weapon == null)
weapon = FindFirstObjectByType<WeaponReload>();
>>>>>>> 85ece045864c59c50ed55097c35e2c15b9051a0f
}
void Update()
{
<<<<<<< HEAD
if (AR == true && Input.GetKey(KeyCode.Mouse0))
=======
if (PauseMenu.GameIsPaused) return;
if (AR == true && Input.GetKey(KeyCode.Mouse0) && Time.time >= nextShotTime)
>>>>>>> 85ece045864c59c50ed55097c35e2c15b9051a0f
{
Shot(spawnPointAR);
nextShotTime = Time.time + fireRate;
}
else if (Pistole == true && Input.GetKeyDown(KeyCode.Mouse0))
{
@@ -27,6 +43,8 @@ public class Shoot : MonoBehaviour
}
public void Shot(Transform spawnPoint)
{
if (spawnPoint == null || weapon == null || !weapon.UseAmmo()) return;
GameObject bullet = Instantiate(bulletPrefab, spawnPoint.position, spawnPoint.rotation);
bullet.transform.Rotate(90, 0, 0);
}