Better systems
var world = World.Create();
world.AddSystem(PlayerMoveSystem)
public static void PlayerMoveSystem((Transform Transform, PlayerMovement Movement)[] components)
{
foreach (var component in components)
{
component.Transform.Position += component.Movement.Velocity;
}
}
Have you looked at https://github.com/genaray/Arch.Extended/wiki/Source-Generator ? I would argue that its way better than bevy like systems tho :)
Does it really require a constructor?
The suggestion doesn't seem to be actually even possible.
(Transform Transform, PlayerMovement Movement)[] is an array of a tuple of two components, in other words a reference (an array) to values (tuples) with two values (Transform and PlayerMovement). Any manipulation with component.Transform.Position changes only the tuple. And a tuple can't contain other references, because it's not a ref struct. So, the following is also not possible: (ref Transform Transform, ref PlayerMovement Movement)[].
ok