Skip to main content

Nest

A class in Root.Township, Alta.Creatures.

A spot creatures can claim as a nest. Enabled nests are free and listed by type, and ActiveNest AI finds and claims them.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private static Dictionary<NestType, HashSet<Nest>> nestsFree nests, by nest type.
private NestType typeThe kind of nest this is.

Properties​

MemberWhat it is
bool IsFree { get; set; }Whether the nest is free. It is the component's enabled flag, so claiming a nest disables it.

Methods​

MemberWhat it is
static Nest FindClosest(NestType type, Vector3 position, float maximumDistance)Returns the closest free nest of a type within the given distance, or null.
2 private and internal methods
MemberWhat it is
private void OnDisable()Removes the nest from the free list.
private void OnEnable()Adds the nest to the free list for its type.

Used in​

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