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

15 lines
430 B
C#
Raw Normal View History

using Saltosion.OneWeapon.Utils;
2019-08-14 16:17:48 +02:00
using Saltosion.OneWeapon.Enemies;
2019-08-03 17:36:17 +02:00
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
}
}
}