コード例 #1
0
        public static unsafe JobHandle CombineDependencies(NativeArray <JobHandle> jobHandles)
        {
            var fence = new JobHandle();

#if UNITY_SINGLETHREADED_JOBS
            fence.JobGroup = JobsUtility.GetFakeJobGroupId();
#if ENABLE_UNITY_COLLECTIONS_CHECKS
            JobsUtility.DebugDidScheduleJob(ref fence, (JobHandle *)jobHandles.GetUnsafeReadOnlyPtr(), jobHandles.Length);
#endif
#else
            JobsUtility.ScheduleMultiDependencyJob(ref fence, JobsUtility.BatchScheduler, (JobHandle *)jobHandles.GetUnsafeReadOnlyPtr(), jobHandles.Length);
#endif
            return(fence);
        }
コード例 #2
0
        public static unsafe JobHandle CombineDependencies(JobHandle one, JobHandle two, JobHandle three)
        {
            var fence        = new JobHandle();
            var dependencies = stackalloc JobHandle[] { one, two, three };

#if UNITY_SINGLETHREADED_JOBS
            fence.JobGroup = JobsUtility.GetFakeJobGroupId();
#if ENABLE_UNITY_COLLECTIONS_CHECKS
            JobsUtility.DebugDidScheduleJob(ref fence, (JobHandle *)UnsafeUtility.AddressOf(ref dependencies[0]), 3);
#endif
#else
            JobsUtility.ScheduleMultiDependencyJob(ref fence, JobsUtility.BatchScheduler, (JobHandle *)UnsafeUtility.AddressOf(ref dependencies[0]), 3);
#endif
            return(fence);
        }