added endscreen

This commit is contained in:
MrTorex committed 2026-02-24 10:32:41 +03:00
1 parent a33eb50ca0
commit 8328f2a979
15 files changed
+991 -89

No files matched your search

+6 -6
View File
@@ -104,10 +104,10 @@ namespace Code.Gameplay.Weapons
SpawnBullet();
if (muzzleFlash != null)
if (muzzleFlash)
muzzleFlash.Play();
if (shootSound != null)
if (shootSound)
audioSource.PlayOneShot(shootSound);
OnShoot();
@@ -115,7 +115,7 @@ namespace Code.Gameplay.Weapons
protected virtual void SpawnBullet()
{
if (bulletPrefab == null) return;
if (!bulletPrefab) return;
var spread = Random.insideUnitSphere * (spreadAngle / 100f);
var direction = (_firePoint.forward + spread).normalized;
@@ -123,7 +123,7 @@ namespace Code.Gameplay.Weapons
var bullet = Instantiate(bulletPrefab, _firePoint.position, Quaternion.LookRotation(direction));
var bulletComponent = bullet.GetComponent<Bullet>();
if (bulletComponent != null)
if (bulletComponent)
{
bulletComponent.Initialize(bulletSpeed, damage, direction);
}
@@ -159,7 +159,7 @@ namespace Code.Gameplay.Weapons
{
isReloading = true;
if (reloadSound != null)
if (reloadSound)
audioSource.PlayOneShot(reloadSound);
yield return new WaitForSeconds(reloadTime);
@@ -178,7 +178,7 @@ namespace Code.Gameplay.Weapons
if (Time.time - lastShotTryTime < fireRate)
return;
lastShotTryTime = Time.time;
if (emptySound != null)
if (emptySound)
audioSource.PlayOneShot(emptySound);
}