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.
The minimum number of commands to perform in a single job.
The maximum number of Colliders the ray can hit.
A JobHandle of a job which must be completed before the raycast starts.
Returns
Type | Description |
|---|---|
| JobHandle | The 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.
The minimum number of commands to perform in a single job.
A JobHandle of a job which must be completed before the raycast starts.
Returns
Type | Description |
|---|---|
| JobHandle | The JobHandle of the job which will perform the raycasts. |
Remarks
By default maxHits in this variant is set to 1.