BloodAndGore/Assets/Scripts/AI/Triggers/PlayerSighted.cs
2019-08-04 20:48:43 +03:00

19 lines
532 B
C#

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;
}
private void OnDrawGizmosSelected() {
Gizmos.color = Color.green;
Gizmos.DrawWireSphere(transform.position, Radius);
}
}
}