so i have a commandBuffer, and i can only create entities from an archetype.
Iam using GameObjectConversionUtility.ConvertGameObjectHierarchy(gameObject, _settings); to convert a gameobject to an entity, Now i would like to spawn this entity via the commandbuffer, but iam missing the method a method like EntityManager.ExtractArchetype(entity);
Mind, you can use outputEntity only for other ecb’s in that update of same frame, unless you call to complete, allowing CommandBuffer to generate entities.
Otherwise, actual entity does not exists yet, until very next frame.
If you try use for example GetComponentFromEntity ( outputEntity ), before entity is actually created you will receive error, saying that entity does not exists.
So you need take one frame delay into consideration.
But as I mentioned, you can set data in very same frame, using ecb’s.
While Antypodish provided you the correct way of doing what you want, to answer your original question (in case someone googles this) you can get an entity archetype using.
var archetype = EntityManager.GetChunk(entity).Archetype;