Ejemplo n.º 1
0
    public unsafe static JobHandle ScheduleWithInt <T>(this T jobData, int value, JobHandle dependsOn = new JobHandle()) where T : struct, IJobWithInt
    {
        JobDataWithInt <T> jobDataWithInt = new JobDataWithInt <T>
        {
            value   = value,
            jobData = jobData
        };
        var scheduleParams = new JobsUtility.JobScheduleParameters(UnsafeUtility.AddressOf(ref jobDataWithInt), JobWithIntStruct <T> .Initialize(), dependsOn, ScheduleMode.Batched);

        return(JobsUtility.Schedule(ref scheduleParams));
    }
Ejemplo n.º 2
0
    public unsafe static void RunWithInt <T>(this T jobData, int value) where T : struct, IJobWithInt
    {
        JobDataWithInt <T> jobDataWithInt = new JobDataWithInt <T>
        {
            value   = value,
            jobData = jobData
        };
        var scheduleParams = new JobsUtility.JobScheduleParameters(UnsafeUtility.AddressOf(ref jobDataWithInt), JobWithIntStruct <T> .Initialize(), new JobHandle(), ScheduleMode.Run);

        JobsUtility.Schedule(ref scheduleParams);
    }
Ejemplo n.º 3
0
 public static void Execute(ref JobDataWithInt <T> jobDataWithInt, IntPtr additionalPtr, IntPtr bufferRangePatchData, ref JobRanges ranges, int jobIndex)
 {
     jobDataWithInt.jobData.Execute(jobDataWithInt.value);
 }