How deep does entity remapping go. Dose Entity in BlobAsset get remapped?

I am using a BlobAsset HashMap (Readonly hash map stored as Blob) as an entity prefab dictionary. Do I need to manually remap Entity stored in this BlobAsset. when It’s loaded from a SubScene?

I haven’t looked recently but last i checked if it fails
TypeManager.HasEntityReferences(typeIndex)
It’s not going to remap

-edit- oh i think your problem is different to what i was assuming

Everything Typeindex related needs to be remapped manually.
https://discussions.unity.com/t/819537

@Joachim_Ante_1
Sorry to interrupt you over and over. Please enlighten me.
If I need to do Entity Remap, where can I look for Entity GUID or something to match entities.

Does anyone have any Ides?

After digging through Unity.Entities source code. I found this class EntityRemapUtility.cs is responsible for Entity remapping and Entity remap is done in chunk and component(ArchyType) level. BlobAsset is not processed in the process. EntityManager.MoveEntity is the main entrance for moving and remapping Entity from world to world.

So any Entity stored in Components is properly remapped. I probably should not store any Entity in BlobAsset as Blob is designed to be used as static binary data across all builds. But Entity is a run time ID, it changes all the time. For Example: Live convert, spawn, Entity scene serialization, Entity scene DeSerialization etc. And there’s seems no good way to remap entity scene entity to running world entity without changing EntityManager.MoveEntity source code.

3 Likes

Thanks for sharing!