After upgrading entities to 12-preview.8 I’m getting an error saying that “Length” has to be initialized with the readonly attribute even though I’ve already marked it as ReadOnly.
Going through the code it seems that there’s a bug on Unity.Entities.InjectComponentGroup.cs #221:
As the injection is done in via a struct, the Length cannot be initialized upfront, thus line 225 will never be called.
Below are some screenshots of the issue:
Is it only me or does anyone else face the same problem?
Right now the workaround is getting the length from one of the injected arrays.