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

14 lines
372 B
C#
Raw Normal View History

2019-08-04 17:35:24 +02:00
using UnityEngine;
namespace Saltosion.OneWeapon.AI.Triggers {
public class PlayerSighted : Trigger {
public float Radius;
public Player Player { get; private set; }
public override bool IsTriggered(Enemy subject) {
Player = Util.GetClosestTo<Player>(transform, Radius, true);
return Player != null;
}
}
}