Babu
A class in Root.Township, Alta.Intelligence.
The babu creature's AI (Agent<Babu>). Has a view cone and an interactor. Its passive set and stunned action are taken from the first babu spawned and shared by all.
- Listed in Creatures and AI
- Inherits or implements
Agent<Babu>,IHasViewCone,IInteractAgent,IAgent,ITarget,ITargetPointer,INetworkEntityBehaviour - Derived types
Babu - Documented in Other creatures, Creature data, Creatures and AI
Constructors
| Member | What it is |
|---|---|
Babu() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private Transform body | Transform whose position is the babu's Position. |
private Interactor interactor | Backing field for Interactor, the interactor the babu eats food with. |
private string killedAnimatorBoolean | Animator bool set on the local animator when the babu dies. Default "Killed". |
private ActionComponentSet passiveActions | The starting action set. Only the first babu's set is used, stored in the static PassiveActions. |
private ActionComponent stunnedAction | The stunned action. Only the first babu's is used, stored in the static Stunned. |
private ViewCone viewCone | Backing field for ViewCone. |
Properties
| Member | What it is |
|---|---|
Interactor Interactor { get; } | The babu's interactor, from IInteractAgent, which actions such as ActiveEat use. |
override Vector3 Position { get; } | The body's position. |
static IAction<Babu> Stunned { get; private set; } | The shared stunned action. |
ViewCone ViewCone { get; } | What it can see, read by its view cone sense. |
protected static ActionSet<Babu> PassiveActions { get; private set; } | The shared passive action set. |
Methods
| Member | What it is |
|---|---|
void Stun(float strength) | Starts the stunned action. strength is not used. Called on the server by the prefab's StatTrigger. |
protected override void InitializeAi() | Starts choosing from the shared passive action set. |
protected override void InitializeStatic() | Stores the passive set and stunned action in statics, once per class. |
protected override void Killed(HealthObject healthobject) | Turns off collision and sets the animator's killed bool. |