Exemplo n.º 1
0
    public unsafe static void Run <T>(this T jobData, int arrayLength) where T : struct, IJobParallelForWithJobIndex
    {
        var scheduleParams = new JobsUtility.JobScheduleParameters(UnsafeUtility.AddressOf(ref jobData), ParallelForWithJobIndexJobStruct <T> .Initialize(), new JobHandle(), ScheduleMode.Run);

        JobsUtility.ScheduleParallelFor(ref scheduleParams, arrayLength, arrayLength);
    }
Exemplo n.º 2
0
    public unsafe static JobHandle Schedule <T>(this T jobData, int arrayLength, int innerloopBatchCount, JobHandle dependsOn = new JobHandle()) where T : struct, IJobParallelForWithJobIndex
    {
        var scheduleParams = new JobsUtility.JobScheduleParameters(UnsafeUtility.AddressOf(ref jobData), ParallelForWithJobIndexJobStruct <T> .Initialize(), dependsOn, ScheduleMode.Batched);

        return(JobsUtility.ScheduleParallelFor(ref scheduleParams, arrayLength, innerloopBatchCount));
    }