| | | 1 | | using UnityEngine; |
| | | 2 | | |
| | | 3 | | // Base implementation of a sensor. |
| | | 4 | | public abstract class SensorBase : ISensor { |
| | | 5 | | // Agent to which this sensor belongs. |
| | 24 | 6 | | public IAgent Agent { get; init; } |
| | | 7 | | |
| | 36 | 8 | | public SensorBase(IAgent agent) { |
| | 18 | 9 | | Agent = agent; |
| | 18 | 10 | | } |
| | | 11 | | |
| | | 12 | | // Sense the target hierarchical object. |
| | | 13 | | public abstract SensorOutput Sense(IHierarchical hierarchical); |
| | | 14 | | |
| | | 15 | | // Sense the target hierarchical object. |
| | | 16 | | public abstract SensorOutput Sense(IAgent agent); |
| | | 17 | | |
| | | 18 | | // Sense the waypoint. |
| | | 19 | | public abstract SensorOutput Sense(in Vector3 waypoint); |
| | | 20 | | } |