Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

How to Avoid Getting Singleton Data on the Main Thread

$
0
0
I have an IJobFor I'd like to schedule, based on the length of a NativeArray. However, that array lives as a DynamicBuffer, on a singleton entity.

To Schedule the IJobFor, I'll need the length of that array. But to access that length, I'll need to call SystemState.GetSingletonData() from my System's update function on the main thread.

I'd like to avoid this. Grabbing that singleton buffer on ever update seems costly. Two questions:

1. Am I worried about nothing? Is this actually a common...

How to Avoid Getting Singleton Data on the Main Thread

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>