De/Activate the behavior
true to enable the behavior, false to disable it
Return true if the behavior is activated
Return true if the object reached its destination.
This method is called each tick after events are done.
This method is called each tick before events are done.
Compute the euclidean distance between two positions.
Get the name of the behavior.
The behavior's name.
Get the name identifier of the behavior.
The behavior's name identifier.
Compute the taxi distance between two positions.
Compute and move on the path to the specified destination.
Reimplement this method to do extra work when the behavior is activated (after
it has been deactivated, see onDeActivate
).
Reimplement this to do extra work when the behavior is created (i.e: an
object using it was created), after the object is fully initialized (so
you can use this.owner
without risk).
Reimplement this method to do extra work when the behavior is deactivated.
This method is called when the owner of the behavior
is being removed from the scene and is about to be destroyed/reused later
or when the behavior is removed from an object (can happen in case of
hot-reloading only. Otherwise, behaviors are just de-activated,
not removed. See onDeActivate
).
This method is called when the owner of the behavior was hot reloaded, so its position, angle, size can have been changed outside of events.
Return true if the latest call to moveTo succeeded.
Called at each frame after events. Call doStepPostEvents.
Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.
The instanceContainer owning the object
Called at each frame before events. Call doStepPreEvents.
Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.
The instanceContainer owning the object
Called when the behavior must be updated using the specified behaviorData. This is the case during hot-reload, and is only called if the behavior was modified.
true if the behavior was updated, false if it could not (i.e: hot-reload is not supported).
Generated using TypeDoc
PathfindingRuntimeBehavior represents a behavior allowing objects to follow a path computed to avoid obstacles.