-
I noticed that when I create an entity with a new
ISharedComponent
(in an otherwise empty scene/world),EntityManager.GetAllUniqueSharedComponentData(List)
returns with a length of 2; with index [1] containing the values of the newISharedComponent
I made, and index[0] with empty/default data.
I couldn’t find if this is supposed to happen, but am guessing yes; since the empty/default data that is filled with zeros still counts as its own unique values, so it will always be there by default. -
But if that is the case, then I have no idea what is going on here: In the same
OnUpdate
, after I call theGetAllUniqueSharedComponentData
, I run a job and callchunk.GetSharedComponentIndex(type)
and it returns an index of 3? And one frame later, in theOnUpdate
the list returns length of 2 again, and the in the chunk the same thing happens and it gets an index of 3. I double checked that I’m calling both of these functions with the sameISharedComponentData
type.
How I understand it is GetSharedComponentIndex
is supposed to return the index specific to the type specified. e.g. if there are 3 different chunks which are separated by having different values of the same ISharedComponentData
type, and these are the only chunks containing this type, calling GetSharedComponentIndex
on each of them would return indexes 0, 1, and 2.
What happens in 1. makes sense, I just want to be double sure… but what happens in 2. is completely puzzling to me… maybe one can confirm my understanding?
All help appreciated, thanks.