Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ScheduleBatch

Schedule a batch of raycasts to perform in a job.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule

ScheduleBatch(NativeArray<RaycastCommand>, NativeArray<RaycastHit>, int, int, JobHandle)

Schedule a batch of raycasts to perform in a job.
public static JobHandle ScheduleBatch(NativeArray<RaycastCommand> commands, NativeArray<RaycastHit> results, int minCommandsPerJob, int maxHits, JobHandle dependsOn = default)

Parameters

A NativeArray of the RaycastCommands to perform.

A NativeArray of the RaycastHits where the results of the commands are stored.

minCommandsPerJob

The minimum number of commands to perform in a single job.

maxHits

The maximum number of Colliders the ray can hit.

dependsOn

A JobHandle of a job which must be completed before the raycast starts.

Returns

Type

Description

JobHandleThe JobHandle of the job which will perform the raycasts.

ScheduleBatch(NativeArray<RaycastCommand>, NativeArray<RaycastHit>, int, JobHandle)

Schedule a batch of raycasts to perform in a job.
public static JobHandle ScheduleBatch(NativeArray<RaycastCommand> commands, NativeArray<RaycastHit> results, int minCommandsPerJob, JobHandle dependsOn = default)

Parameters

A NativeArray of the RaycastCommands to perform.

A NativeArray of the RaycastHits where the results of the commands are stored.

minCommandsPerJob

The minimum number of commands to perform in a single job.

dependsOn

A JobHandle of a job which must be completed before the raycast starts.

Returns

Type

Description

JobHandleThe JobHandle of the job which will perform the raycasts.

Remarks

By default maxHits in this variant is set to 1.