Class GoHereAction
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
-
JsonTypeSafeGenericDataHolderGoHereAction
- 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
typeActionTypeThe type for this action.
infoActionInfoThe 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
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
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
typeCompletionTypeThe completion of the main action
CanActionInterrupt(Action)
Determines whether the given action can interrupt this action.
If this method returns true, it is usually followed by a call to Interrupt(CompletionType). To call this method effectively, use ActionInterruptAction(Action, Action, CompletionType, bool).
This method returns false by default, and MultiAction returns true only if the main action has not yet started.
public override bool CanActionInterrupt(Action action)
Parameters
actionActionThe action trying to interrupt this action.
Returns
- bool
Whether the action can interrupt this action.
CanGenericInterrupt(bool)
Determines whether this action can be interrupted by a generic interruption source. If this method returns true, it is usually followed by a call to Interrupt(CompletionType). To call this method effectively, use GenericInterruptAction(Action, bool, CompletionType, bool). This method returns true by default.
public override bool CanGenericInterrupt(bool isPlayer)
Parameters
isPlayerboolWhether the generic interruption source is the player.
Returns
- bool
Whether a generic interruption source can interrupt this action.
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