From an API perspective, is there any real difference from the approaches bellow?
Entities.ForEach((ref MovementSpeed speed, GameObjectEntity go) => {
Rigidbody2D body = go.GetComponent<Rigidbody2D>(); // This might hurt a little bit since it requests for a mono
body.velocity = new Vector2(speed.Value.x, speed.Value.y);
});
Firstly, GameObjectEntity will be deprecated in favour of the ConversionAPI, since we want to avoid linking entities with gameObjects specifically. (Dunno when but it’ll happen one day.)
The former with the ((ref MovementSpeed speed, GameObjectEntity go) => {}), requires you do a GetComponent() every frame the system updates. You still get the correct chunk though, you’re just doing an extra step to grab the Rigidbody.
The latter looks through the chunks and looks through the mappings of entity + component data to get the correct data you need. You can think of it like a database and a search through the database to get the exact data you need; for a lack of a better analogy.