A class in Root.Township, Alta.Intelligence.
A creature AI sense asset whose value is read straight from the target's sense intensity array, at a slot assigned when the asset initializes.
Constructors
| Member | What it is |
|---|
BasicSense() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
| Member | What it is |
|---|
const int IndexCount | Number of sense slots (32). |
2 private and internal fields
| Member | What it is |
|---|
private int index | Backing field for Index. |
private static List<BasicSense> senses | Static list of every registered BasicSense; a sense's position in it is its index. |
Properties
| Member | What it is |
|---|
int Index { get; } | Slot of this sense in the intensity array, assigned on Initialize. -1 before that. |
Methods
| Member | What it is |
|---|
static BasicSense FromIndex(int index) | Returns the registered sense at a slot, or null if no sense has that slot yet. |
override float Get(IAgent requester, ITarget target) | Returns the target's intensity for this sense, read from target.Senses.Intensities at Index. |
override void Initialize() | Registers the sense in the static list and assigns its Index if it doesn't have one. |
Used in
Members of other types that take, return or hold a BasicSense: