Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ScheduleBatch

Schedules a batch of sphere casts to perform in a job.
Read time 1 minuteLast updated 5 days ago

Definition

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

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

Schedules a batch of sphere casts to perform in a job.
public static JobHandle ScheduleBatch(NativeArray<SpherecastCommand> commands, NativeArray<RaycastHit> results, int minCommandsPerJob, int maxHits, JobHandle dependsOn = default)

Parameters

A NativeArray of SpherecastCommands to perform.

A NattiveArray of RaycastHit where the result of commands are stored.

minCommandsPerJob

The minimum number of commands to perform in a job.

maxHits

The maximum number of Colliders the SphereCast can hit.

dependsOn

A JobHandle of the job that must be completed before performing the sphere casts.

Returns

Type

Description

JobHandleReturns a JobHandle of the job that will perform the sphere casts.

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

Schedules a batch of sphere casts to perform in a job.
public static JobHandle ScheduleBatch(NativeArray<SpherecastCommand> commands, NativeArray<RaycastHit> results, int minCommandsPerJob, JobHandle dependsOn = default)

Parameters

A NaviveArray of SpherecastCommands to perform.

A NavtiveArray of RaycastHit where the result of commands are stored.

minCommandsPerJob

The minimum number of commands to perform in a job.

dependsOn

A JobHandle of the job that must be completed before performing the sphere casts.

Returns

Type

Description

JobHandleReturns a JobHandle of the job that will perform the sphere casts.

Remarks

By default maxHits in this variant is set to 1.