onSpawn property

void Function(EntityCommands entity, TiledObjectData object)? onSpawn
final

Callback for custom setup when this object type is spawned.

Called after the entity is created with Transform2D, GlobalTransform2D, TiledObject, and optionally Collider. Use this to add custom components based on the object's properties.

Implementation

final void Function(EntityCommands entity, TiledObjectData object)? onSpawn;