added endscreen
This commit is contained in:
1 parent
a33eb50ca0
commit
8328f2a979
15 files changed
+991
-89
No files matched your search
@@ -64,7 +64,7 @@ namespace Code.Gameplay.Enemy
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!IsAlive || target == null) return;
|
||||
if (!IsAlive || !target) return;
|
||||
|
||||
var distanceToTarget = Vector3.Distance(transform.position, target.position);
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace Code.Gameplay.Enemy
|
||||
private void Attack()
|
||||
{
|
||||
if (Time.time - lastAttackTime < attackCooldown) return;
|
||||
if (weapon == null) return;
|
||||
if (!weapon) return;
|
||||
|
||||
if (!HasLineOfSight()) return;
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace Code.Gameplay.Enemy
|
||||
|
||||
private bool HasLineOfSight()
|
||||
{
|
||||
if (target == null) return false;
|
||||
if (!target) return false;
|
||||
|
||||
var direction = (target.position - weaponPoint.position).normalized;
|
||||
var distance = Vector3.Distance(weaponPoint.position, target.position);
|
||||
|
||||
Reference in new issue
Block a user