Selectors
Selectors are used by the layout system to determine what and how to load. Each Selector has a reference to one or more TileFabs (but usually just one) and a LoadFlags field.
There are two types provided with this distribution: SingleFabChunkSelector
and ChunkZoneSelector
.
SingleFabChunkSelector
is very simple and just causes the same TileFab to be painted to each Zone. This Selector does not accommodate variable Chunk Size: Chunk Size is the size of the TileFab referenced by the SingleFabChunkSelector.
ChunkZoneSelector
is almost the same, however, its initialization method causes all the child Bundles of the referenced TileFab to subdivide themselves into the specified chunk size.
When Bundles “Chunkify” themselves, they ready their tiles for Tilemap loading using SetTiles(TileChangeDataArray). The tiles are organized into several small arrays; one for each Chunk. For example, if a Bundle has a size of 512 x 512 and the Chunk Size is for the TScene is 128 then the Bundle is subdivided into 16 chunks arranged in a 4 x 4 matrix. Since this is performed at runtime, you can use any applicable chunk size.
This is a big advantage since you can easily tweak the chunk size during development or even in a deployed app for performance optimization on different platforms.