BloodAndGore/Assets/Scripts/AI/Triggers/EnemySighted.cs

14 lines
381 B
C#
Raw Normal View History

2019-08-03 17:36:17 +02:00
using UnityEngine;
namespace Saltosion.OneWeapon.AI.Triggers {
public class EnemySighted : Trigger {
public float Radius;
public Enemy ClosestEnemy { get; private set; }
public override bool IsTriggered(Enemy subject) {
2019-08-03 18:14:47 +02:00
ClosestEnemy = Util.GetClosestTo<Enemy>(transform, Radius);
return ClosestEnemy != null;
2019-08-03 17:36:17 +02:00
}
}
}