Skip to main content

FacingOperation

A class in Root.Township, Alta.Intelligence.

Older prefab scoring component for how much the creature faces the target. In the editor it migrates itself to a SenseOperation.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private float dotProductMaximumFacing dot product that maps to 1 (default 1, dead ahead).
private float dotProductMinimumFacing dot product that maps to 0 (default 0.8).
private bool isIgnoringYUse the flat Facing2D sense instead of Facing3D (default true).
private float multiplierWeight of the rule. Only matters for preferred rules.

Methods​

MemberWhat it is
override TargetOperation GetOperation()Makes a target sense rule on the Facing2D (or Facing3D) sense, mapping the dot product range onto 0 to 1.
protected override string GetName()Builds the GameObject name, like Facing XZ 0.8 -> 1 (x1).
protected override void OnValidate()Editor: renames the GameObject and migrates the settings to a SenseOperation.