Table of Contents

Class GoHereAction

Namespace
TinyLife.Actions
Assembly
Tiny Life.dll

A go here action is an action that uses two underlying actions for its execution: an action where a person walks to a goal and an action where a person drives to a goal. This is the action class used by GoHere.

public class GoHereAction : MultiAction, IGenericDataHolder
Inheritance
JsonTypeSafeGenericDataHolder
GoHereAction
Implements
IGenericDataHolder
Inherited Members
JsonTypeSafeGenericDataHolder.GetDataKeys()
Extension Methods

Constructors

GoHereAction(ActionType, ActionInfo)

Creates a new action with the given action information.

public GoHereAction(ActionType type, ActionInfo info)

Parameters

type ActionType

The type for this action.

info ActionInfo

The information for this action.

Fields

DriveSpeedMultiplier

The speed multiplier that is passed to this action's underlying DriveAction's SpeedMultiplier. By default, this value is set to 1.

[DataMember]
public float DriveSpeedMultiplier

Field Value

float

WalkSpeedMultiplier

The speed multiplier that is passed to this action's underlying WalkAction's SpeedMultiplier. By default, this value is set to 1.

[DataMember]
public float WalkSpeedMultiplier

Field Value

float

Methods

AndThenIsCompleted()

MultiAction version of IsCompleted(). This method returns whether or not the main action is completed.

protected override CompletionType AndThenIsCompleted()

Returns

CompletionType

Whether the main action is completed

AndThenOnCompleted(CompletionType)

MultiAction version of OnCompleted(CompletionType). This method gets called when the main action completes.

protected override void AndThenOnCompleted(CompletionType type)

Parameters

type CompletionType

The completion of the main action

CanCancel(Action)

Returns whether or not this action can be canceled by the given outside source. Note that the outside source can be null, and if it is, it means that the player canceled the action manually. By default, actions can only be canceled if the cancelSource is null.

public override bool CanCancel(Action cancelSource)

Parameters

cancelSource Action

The source of the cancelation, or null if the player canceled it

Returns

bool

true if the action can be canceled

CreateFirstActions()

Return a set of actions that should be executed before this action. Even if the yield statement is used, all actions will be collected into a list at the start of this action's invocation. If no action gets returned in this function, this action fails. If the returned set only contains null items, no first actions will be executed.

protected override IEnumerable<Action> CreateFirstActions()

Returns

IEnumerable<Action>

A set of actions that should run before this action