Additional ECS Examples
In order for the additional example scenes provided in the asset to work, which you can find inside the ECS.unitypackage, the following software versions and packages have to be installed:
- Unity 2022.3 or above
- URP 14 or above
- Entities 1.0 or above
- Entities Graphics 1.0 or above
Once the setup is complete, it should in general be possible to integrate the data structures and algorithms into ISystem with relative ease. The example scenes are doing it as well, so you can always look up the way in which this is achieved there, if you get stuck.
For the generic data structures (especially the generic trees), it might be necessary to tell the Burst Compiler to compile the jobs for specific types in advance!
This is necessary, since Burst cannot detect them automatically when they are within an ISystem. For more information, visit this page: Generic Jobs
This is done by registering them within the assembly you are going to use the jobs. Here are two examples:
[assembly: RegisterGenericJobType(typeof(GimmeDOTSGeometry.NativeSparseQuadtree<int>.GetCellsInRadiusJob))]
[assembly: RegisterGenericJobType(typeof(GimmeDOTSGeometry.Native2DRStarTree<MyCustomComponent>.GetRectanglesInPolygonJob))]
All jobs are public members of the generic data structures, so you can declare them like this, for this exact reason.