Delay start of Job?

I have an odd issue, because some of the data I need cannot be used in an iComponentData I have to gather some data and hold on to it in a standard List. When the Job starts this list has not been filled, and I would prefer not checking to see if this data is ready each time the job is run. (eg: A bool isFound, and if false, attempt to get data) This sort of hack will work, but I would rather not…

So the base question; Is there a way to pause starting a job script. Standard Mono scripts can be inactive and will only start when set to active, this is the sort of thing I am looking to achieve.

Thanks kindly.

I bet you are looking for Struct NativeList<T> | Package Manager UI website and function:
AsDeferredJobArray()

1 Like

Kmiecis is correct, however you have linked a pretty old manual. Always use @latest Redirecting to latest version of com.unity.collections which will take you to the most recent version of the documentation

https://docs.unity3d.com/Packages/com.unity.collections@0.1/api/Unity.Collections.NativeList-1.html

You’ll notice these documents are quite different as there are new methods added, new interfaces etc (though for this particular method it is the same.)

(I really should write a bot auto correct manual links)

2 Likes

Thank you both for your answer. I will keep that in mind.

My answer was to go back to the drawing board. I am using Easy Roads 3D and I believe what I now need to do is create the data that the roads have into Entities and then query this.