Hmmm… accordingly to that doc I would assume that this would work? System 1 filters like this:
private struct FilterData
{
public readonly int Length;
public ComponentDataArray<TemperatureModifierQueueComponent> TemperatureModifierQueueSize;
public FixedArrayArray<TemperatureModifierQueue> TemperatureModifiersQueue;
public ComponentDataArray<TemperatureModifierSizeComponent> TemperatureModifierSize;
public FixedArrayArray<TemperatureModifier> TemperatureModifiers;
}
System 2 filters like this:
private struct FilterData
{
public readonly int Length;
public ComponentDataArray<TemperatureComponent> Temperature;
[ReadOnly] public ComponentDataArray<TemperatureModifierSizeComponent> TemperatureModifierSize;
[ReadOnly] public FixedArrayArray<TemperatureModifier> TemperatureModifiers;
}
Yet, when I run, system 2 is trying to schedule the job before system 1, as evidenced by the message InvalidOperationException: The previously scheduled job TemperatureModifierJob reads from the NativeArray TemperatureModifierJob.TemperatureModifierSize. You are trying to schedule a new job TemperatureModifierQueueJob, which writes to the same NativeArray (via TemperatureModifierQueueJob.TemperatureModifierSize). To guarantee safety, you must include TemperatureModifierJob as a dependency of the newly scheduled job.
Btw, on System 2 I am scheduling the job like this:
return new TemperatureModifierJob
{
Temperature = _entities.Temperature,
TemperatureModifierSize = _entities.TemperatureModifierSize,
TemperatureModifiers = _entities.TemperatureModifiers
}.Schedule(_entities.Length, 1, handle);
Which means, using the handle as dependency, which is what I understood would be the case? I also still have the [UpdateAfter(typeof(System1))] in there but that apparently is not used in any way cause of what you described… but according to the docs, since System1 Reads and Writes to TemperatureModifierSizeComponent, and System2 only reads from it, it should automatically pass it as a dependency in the handle?
At any rate, thanks for the help,
Best,
Allan