I cant get this to schedule using the final jobhandle(handle3), only when I force complete each job individually. I feel like im missing something super basic here? cellHashMap is a NativeHashmap
Each time it spits out InvalidOperationException: The previously scheduled job CollapseRandomCellJob writes to the Unity.Collections.NativeHashMap2[Unity.Mathematics.int3,Junk.Yard.CellData] CollapseRandomCellJob.HashMap. You must call JobHandle.Complete() on the job CollapseRandomCellJob, before you can read from the Unity.Collections.NativeHashMap 2[Unity.Mathematics.int3,Junk.Yard.CellData] safely.
var handle1 = new SetupJob {
HashMap = cellHashMap,
CellScale = CellScale,
GridSize = GridSize,
Position = transform.position,
}.Schedule();
var handle2 = new CollapseRandomCellJob {
GridSize = GridSize,
Seed = seed,
Iterations = iterations,
HashMap = cellHashMap
}.Schedule(handle1);
var handle3 = new CollapseAndSolveAllJob{
Iterations = iterationMultiplier * cellHashMap.Count,
HashMap = cellHashMap,
}.ScheduleParallel(cellHashMap.Count, 4, handle2);
handle3.Complete();