OldSenseOperation
A class in Root.Township, Alta.Intelligence.
Older prefab scoring component that names its sense with the SenseOld enum. In the editor it replaces itself with a SenseOperation once a matching sense asset exists.
- Listed in Creatures and AI
- Inherits or implements
TargetOperationComponent
Constructors
| Member | What it is |
|---|---|
OldSenseOperation() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private float from | Sense value that maps to 0. |
private bool isTarget | Read the sense on the target (true) or on the creature itself. |
private float multiplier | Weight of the rule. Only matters for preferred rules. |
private SenseOld sense | The old enum value naming the sense. |
private float to | Sense value that maps to 1. |
Methods
| Member | What it is |
|---|---|
override TargetOperation GetOperation() | Makes a sense rule for the sense asset mapped to this SenseOld value. |
static void Migrate(Component old, SenseOld sense, float from, float to, bool isTarget, float multiplier) | Editor: moves an old scoring component's settings onto a SenseOperation, or onto an OldSenseOperation if no sense asset matches. |
protected override string GetName() | Builds the GameObject name, like Danger 0 -> 1 (x1). |
protected override void OnValidate() | Editor: renames the GameObject and migrates to a SenseOperation if possible. |