In pre-ECS I have my data as an array of Vector3 which takes an index of 0~4 to access. But now that I use ECS IComponentData cannot accept arrays or even native containers. For this
- If I want to keep the rest of my code intact I would have to find a way to index this data. The obvious way is to
iforswitch caseon the indexer and link to each data individually. But I heard you need to stay away from branching in job codes so I usemath.selectlike the documentation says. But it looks very ugly as you can see. Any better way than this?
- I just put some variables with custom names on it. Is there any way to say “5 float3 here” or something in
IComponentData? If I can do that I might not need all thatmath.selectand maybe have some ways to map integer to the correct data. Fixed length is fine, and that would be still in IComponentData’s design. Kind of like this :
Then throws at runtime if you attempts to use out of bounds memory etc.

