public static unsafe JobHandle Schedule <T, U0>(this T jobData, ComponentGroupArray <U0> array, int innerloopBatchCount, JobHandle dependsOn = new JobHandle()) where T : struct, IJobProcessEntities <U0> where U0 : struct { JobStruct <T, U0> fullData; fullData.Data = jobData; fullData.Array = array.m_Data; var scheduleParams = new JobsUtility.JobScheduleParameters(UnsafeUtility.AddressOf(ref fullData), JobStruct <T, U0> .Initialize(), dependsOn, ScheduleMode.Batched); return(JobsUtility.ScheduleParallelFor(ref scheduleParams, array.Length, innerloopBatchCount)); }
public static unsafe void Run <T, U0>(this T jobData, ComponentGroupArray <U0> array) where T : struct, IJobProcessEntities <U0> where U0 : struct { JobStruct <T, U0> fullData; fullData.Data = jobData; fullData.Array = array.m_Data; var scheduleParams = new JobsUtility.JobScheduleParameters(UnsafeUtility.AddressOf(ref fullData), JobStruct <T, U0> .Initialize(), new JobHandle(), ScheduleMode.Run); var entityCount = array.Length; JobsUtility.ScheduleParallelFor(ref scheduleParams, entityCount, entityCount); }