Skip to main content

ViewConeOperation

A class in Root.Township, Alta.Intelligence.

Inspector component that adds a view cone sense check to an AI action's target scoring. Its OnValidate migrates it to the newer sense operation setup.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private float fromSense value that maps to a score of 0 (the start of the range).
private float multiplierWeight applied to the operation. Only used when it's in a preferred list.
private float toSense value that maps to a score of 1 (the end of the range).

Methods​

MemberWhat it is
override TargetOperation GetOperation()Returns a target operation that maps the view cone sense from from to to, weighted by multiplier.
protected override string GetName()Builds the GameObject name from the settings, such as View Cone 1 -> 0 (x1).
protected override void OnValidate()Editor: renames the GameObject and migrates the settings into an OldSenseOperation.