Skip to main content

TargetCollector

A class in Root.Township, Alta.Intelligence.

Component that gathers targets for an agent within a radius. Registers itself with its agent on Awake; TargetCollectorManager adds and removes targets by distance.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private Agent agentBacking field for Agent.
private float radiusSquaredBacking field for RadiusSquared.

Properties​

MemberWhat it is
Agent Agent { get; }The agent that receives the collected targets.
Vector3 Position { get; private set; }The agent's position as of the last GetPosition call.
float RadiusSquared { get; }Squared range within which targets are collected. Default 400, so a radius of 20.
1 private and internal property
MemberWhat it is
private int IBuildRendererBakeable.SortingOrder { get; }Always 0.

Methods​

MemberWhat it is
Vector3 GetPosition()Updates Position to the agent's current position and returns it.
4 private and internal methods
MemberWhat it is
private void Awake()Registers this collector with its agent.
private void IBuildRendererBakeable.Bake(bool isSaving)Build step. Does nothing.
private void IBuildRendererBakeable.Clean()Build step: on Android builds, removes the collector's game object if nothing else is on it.
private void OnDrawGizmosSelected()Editor: draws the collection radius as a green sphere.

Used in​

Members of other types that take, return or hold a TargetCollector: