NativeSetClassTypeToNullOnScheduleAttribute
Sets the managed reference to a class to null on a copy of the job struct that is passed to a job.
읽는 시간 3분최근 업데이트: 한 달 전
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.