Dragonfly
A class in Root.Township, Alta.Intelligence.
Creature class for the dragonfly and the Dais herd animals: a body, a view cone, a passive set and a stunned action. Server AI; Killed runs on both sides.
- Listed in Creatures and AI
- Inherits or implements
Agent<Dragonfly>,IHasViewCone - Derived types
Dragonfly - Documented in Other creatures, Creature data, Creatures and AI
Constructors
| Member | What it is |
|---|---|
Dragonfly() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|---|
private Transform body | Transform whose position is the creature's Position. |
private string killedAnimatorBoolean | Animator bool set on death. Default "Killed". |
private ActionComponentSet passiveActions | The action set the creature starts with. |
private static Dictionary<ActionComponentSet, ActionSet<Dragonfly>> passiveActionSetMap | Static cache of the action set built from each passive set asset. |
private ActionComponent stunnedAction | The action component for the stunned action. |
private static Dictionary<ActionComponent, ActionTarget<Dragonfly>> stunnedActionMap | Static cache of the stunned action built from each action component. |
private ViewCone viewCone | Backing field for ViewCone. |
Properties
| Member | What it is |
|---|---|
override Vector3 Position { get; } | The body transform's position. |
ActionTarget<Dragonfly> Stunned { get; private set; } | The stunned action, with no target. |
ViewCone ViewCone { get; } | The creature's view cone, used by view cone senses and actions. |
Methods
| Member | What it is |
|---|---|
void Stun(float strength) | Server: starts the stunned action. strength is ignored. Called by a StatTrigger on the prefab. |
protected override void InitializeAi() | Server: picks the passive set and the stunned action, building each once per asset. |
protected override void InitializeStatic() | Creates the shared set and stunned action caches, once per class. |
protected override void Killed(HealthObject healthobject) | Turns off collision and sets the killed animator bool on the local animator. |