20 lines
565 B
C#
20 lines
565 B
C#
using UnityEngine;
|
|
using Saltosion.OneWeapon.Utils;
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|