unsafe public static void Run <T>(this T jobData, int arrayLength) where T : struct, IJobParallelForFor { var scheduleParams = new JobsUtility.JobScheduleParameters( UnsafeUtility.AddressOf(ref jobData), ParallelForForJobStruct <T> .Initialize(), new JobHandle(), ScheduleMode.Run); JobsUtility.ScheduleParallelFor( ref scheduleParams, arrayLength, arrayLength); }
unsafe public static JobHandle Schedule2 <T>( this T jobData, int arrayLength, int innerloopBatchCount, JobHandle dependsOn = new JobHandle()) where T : struct, IJobParallelForFor { var scheduleParams = new JobsUtility.JobScheduleParameters( UnsafeUtility.AddressOf(ref jobData), ParallelForForJobStruct <T> .Initialize(), dependsOn, ScheduleMode.Batched); return(JobsUtility.ScheduleParallelFor( ref scheduleParams, arrayLength, innerloopBatchCount)); }