Skip to main content

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.

Constructors​

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

Fields​

6 private and internal fields
MemberWhat it is
private Transform bodyTransform whose position is the babu's Position.
private Interactor interactorBacking field for Interactor, the interactor the babu eats food with.
private string killedAnimatorBooleanAnimator bool set on the local animator when the babu dies. Default "Killed".
private ActionComponentSet passiveActionsThe starting action set. Only the first babu's set is used, stored in the static PassiveActions.
private ActionComponent stunnedActionThe stunned action. Only the first babu's is used, stored in the static Stunned.
private ViewCone viewConeBacking field for ViewCone.

Properties​

MemberWhat 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​

MemberWhat 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.