ientityspawnloadingservice
This is an old revision of the document!
CREAT3D.ECS.Services.ChunkManagement
IEntitySpawnLoadingService
This service's primary responsibility is to load EntitySpawns into a specified Chunk. It unwraps spawn hierarchies into a flat loading list, validates their referenced entity static data, creates entity instances, restores parent-child transform relationships, and then broadcasts entity creation. Loading is performed through a coroutine so large spawn collections can be processed over multiple frames.
Broadcasts Events: EntitySpawnLoadingStartedTopic, EntitySpawnLoadingProgressTopic, EntitySpawnLoadingCompleteTopic
Methods
| Method | Task LoadEntitySpawns(EntitySpawn[] entitySpawns, Chunk chunk, CancellationToken cancellationToken) |
|---|---|
| Description | Loads all valid EntitySpawns into the specified Chunk. The method first unwraps the supplied spawn collection, including nested child spawns, into a flat list while preserving hierarchy information. Spawns with missing static data IDs, unresolved static data, or missing transform data are skipped. If no valid spawns are found, nothing happens. Loading then runs through a coroutine in three stages: entity creation, transform parenting, and entity creation broadcasting. Progress is broadcast during loading according to the configured loading frequency. |
ientityspawnloadingservice.1777138482.txt.gz · Last modified: by diviner
