Skip to main content

BasicSense

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​

MemberWhat it is
BasicSense()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

MemberWhat it is
const int IndexCountNumber of sense slots (32).
2 private and internal fields
MemberWhat it is
private int indexBacking field for Index.
private static List<BasicSense> sensesStatic list of every registered BasicSense; a sense's position in it is its index.

Properties​

MemberWhat it is
int Index { get; }Slot of this sense in the intensity array, assigned on Initialize. -1 before that.

Methods​

MemberWhat 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: