decline-cookies / anvil-unity-dots

Unity DOTS and ECS specific additions and extensions to Anvil
MIT License
4 stars 1 forks source link

Build BurstableAtomicIDProviderSystem #265

Open jkeon opened 1 year ago

jkeon commented 1 year ago

See: https://github.com/decline-cookies/anvil-unity-dots/pull/258/files#r1220141780

Have a system that creates the IDProviders for you and stores a reference to them. Every so often (configurable, could be frame or X seconds) it will check them all against their SupplyWarningThreshold and emit an event for the main thread application to listen to and respond to similar to IDProvider

mbaker3 commented 1 year ago

Ah yea, I was thinking the BurstableAtomicIDProvider would register itself with the system but this makes more sense because you need a World reference anyway and this better matches the pattern you follow for ECBs.

The system can probably just check every frame. It's not going to be expensive and there aren't going to be tens of thousands of ID providers.