Hello, I want to be able to read component values of entities that I’ve created from prefabs.
Note that when i click
, Inspector shows up in Prefab mode.
Instead of that, i’d like to see the components and their values of that entity.
All of the modes (
Runtime) result in the same behaviour.
However this problem doesn’t happen if the entity was “placed” before runtime:
The entities (bugged ones) I mentioned are instantiated via EntityManager.Instantiate() method after I start the game. And as parameter i am giving prefab gameobjects (converted to entities when game starts by a baker). However if I place the gameobjects into the subscene before game starts there are no problems. I get the desired result (seeing their component values on inspector).
I remember adding objects to a sub-scene once that resulted in a buggy broken state of them not being converted at all.
They all looked “parented” in the UI hierarchy sense, but not ended being actually moved inside this scene and just stayed saved as children of the current scene. You can check this by opening this sub-scene and checking if these objects are even there.
I fixed it by removing these objects (unparenting them) and then moving them back to this sub-scene again.
Yes. This is the correct workflow, introduced in
entities 1.0 and as described in the documentation
entities 0.5 introduced something called
"conversion workflow" (turning
GameObject prefab into an
Entity after game started) but this is obsolete workflow now.
entities 1.0 means that all
Entity happens in the Editor; BEFORE game starts (and game is built).