ドキュメント

Unity Engine

Unity Engine

ScheduleByRef<T>(ref T, JobHandle)

Schedules the job for execution on a worker thread.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: Unity.Jobs
  • Assembly: UnityEngine.ManagedKernelModule

ScheduleByRef<T>(T, JobHandle)

public static JobHandle ScheduleByRef<T>(this ref T jobData, JobHandle dependsOn = default) where T : struct, IJob

Parameters

jobData

T
The job and data to schedule.

dependsOn

The dependency of the job. Dependencies ensure that a job executes on worker threads after the dependency has completed execution, and that two jobs reading or writing to same data do not run in parallel.

Returns

Type

Description

JobHandleThe handle identifying the scheduled job, which you can use as a dependency for a later job or to ensure completion on the main thread.

Remarks

This variant passes the job struct by reference instead of by value, which can be faster than IJobExtensions.Schedule for larger job structs. Note that worker threads always operate on a local copy of the job struct.
Additional Resources: IJob