Merge branch 'main' of https://git.bib.de/PBA3H25ABU/ClearTheZone
# Conflicts: # Assets/Scenes/Story1.unity # Assets/Scenes/Story1.unity.rej # Assets/Scripts/Bullet.cs # Assets/Scripts/EnemyHealth.cs # Assets/Scripts/Shoot.cs
This commit is contained in:
+26
-2
@@ -6,12 +6,17 @@ 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
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
if (weapon == null)
|
||||
@@ -21,11 +26,19 @@ public class Shoot : MonoBehaviour
|
||||
if (weapon == null)
|
||||
weapon = FindFirstObjectByType<WeaponReload>();
|
||||
>>>>>>> parent of 392d236 (Merge branch 'main' of https://git.bib.de/PBA3H25ABU/ClearTheZone)
|
||||
=======
|
||||
|
||||
=======
|
||||
if (weapon == null)
|
||||
weapon = FindFirstObjectByType<WeaponReload>();
|
||||
>>>>>>> 85ece045864c59c50ed55097c35e2c15b9051a0f
|
||||
>>>>>>> 392d23632b62942df19732b9e125c98967abd9e4
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
|
||||
if ( AR == true && Input.GetKey(KeyCode.Mouse0))
|
||||
@@ -39,8 +52,18 @@ public class Shoot : MonoBehaviour
|
||||
|
||||
if (AR == true && Input.GetKey(KeyCode.Mouse0) && Time.time >= nextShotTime)
|
||||
>>>>>>> parent of 392d236 (Merge branch 'main' of https://git.bib.de/PBA3H25ABU/ClearTheZone)
|
||||
=======
|
||||
|
||||
if (AR == true && Input.GetKey(KeyCode.Mouse0))
|
||||
=======
|
||||
if (PauseMenu.GameIsPaused) return;
|
||||
|
||||
if (AR == true && Input.GetKey(KeyCode.Mouse0) && Time.time >= nextShotTime)
|
||||
>>>>>>> 85ece045864c59c50ed55097c35e2c15b9051a0f
|
||||
>>>>>>> 392d23632b62942df19732b9e125c98967abd9e4
|
||||
{
|
||||
Shot(spawnPointAR);
|
||||
nextShotTime = Time.time + fireRate;
|
||||
}
|
||||
else if (Pistole == true && Input.GetKeyDown(KeyCode.Mouse0))
|
||||
{
|
||||
@@ -49,8 +72,9 @@ 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);
|
||||
Destroy(bullet, 2);
|
||||
bullet.transform.Rotate(90, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user