Skip to main content

SenseOperation

A class in Root.Township, Alta.Intelligence.

Prefab scoring component that adds a sense rule: a sense asset read on the target or the creature, mapped onto 0 to 1. The older scoring components migrate to this one.

Constructors​

MemberWhat it is
SenseOperation()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

5 private and internal fields
MemberWhat it is
private float fromSense value that maps to 0.
private bool isTargetRead the sense on the target (true) or on the creature itself.
private float multiplierWeight of the rule. Only matters for preferred rules.
private Sense senseThe sense asset read.
private float toSense value that maps to 1 (default 1).

Methods​

MemberWhat it is
override TargetOperation GetOperation()Makes the sense rule with these settings, weighted by multiplier.
static void Migrate(Component old, Sense sense, float from, float to, bool isTarget, float multiplier)Editor: adds or reuses a SenseOperation on the old component's GameObject and copies the settings over.
protected override string GetName()Builds the GameObject name, like Danger 0 -> 1 (x1).