NativeSetClassTypeToNullOnScheduleAttribute
Sets the managed reference to a class to null on a copy of the job struct that is passed to a job.
読み終わるまでの所要時間 3 分最終更新 1ヶ月前
Definition
- Type: Class
- Namespace: Unity.Collections.LowLevel.Unsafe
- Assembly: UnityEngine.CoreModule
- Inherits from: Attribute
[AttributeUsage(AttributeTargets.Field)]public sealed class NativeSetClassTypeToNullOnScheduleAttribute : Attribute
Remarks
The job system doesn't allow managed references in a job struct. However, sometimes it's necessary to have a class in a job struct, even though in the context of the job it is always null. When this attribute is applied to a field in a job struct, the managed reference to the class is set to null on the copy of the job struct that's passed to the job.
Additional Resources: IJob.