Entities
An entity is just an integer ID. It has no data of its own — all state is stored in components.
Creating Entities
Each call to Spawn() returns a unique integer ID.
Variadic Spawn
You can spawn an entity and attach components in a single call:
SpawnMeshEntity
For entities that need a mesh, SpawnMeshEntity creates the entity, attaches a Transform and MeshComponent, and registers it with the native renderer in one call:
Destroying Entities
Despawn removes the entity and all its attached components. It automatically handles cleanup:
- If the entity has a
MeshComponent, the native renderer entity is removed viaNativeBridge.RemoveEntity()— no manual cleanup needed - If the entity has children (via
Hierarchy), they are recursively despawned as well
Checking Alive Status
Multi-Entity Example
You can create many entities sharing the same mesh (instancing the same geometry):
Each entity gets its own renderer draw slot but shares the GPU mesh data.