Layout System Nomenclature
Name | Class Type | Use |
---|---|---|
TileFabLib | Static | Loads TileFabs, supervises ZoneManager instances. |
ZoneManagerLib | Static | Utilities for ZoneManagers |
TpChunkedSceneManager | Component | Loads TScenes (Tile Scenes) under your control. |
TpZoneLayout | Component | Controls layout as the camera moves |
Selector | Scriptable Object | Selects what to load |
TpZoneManager | Scriptable Object | Manages what’s loaded and where |
TSceneInitializer | Scriptable Object | Initialize your app after TScene loaded |
TSceneList | Scriptable Object | A list of TScenes used by TpChunkedSceneManager |
TScene | C# class | A field in the TSceneList with one or more TSceneSpecs. |
TSceneSpec | C# class | A field in the TScene, specifies the TpZoneLayout to use. |
TpTilePositionDb | Scriptable Runtime Service | Optional ‘database’ of occupied positions on the Tilemaps. |
We also use TScene to refer to the actual Tile Scene, that is, the original design scene where you create the design using tiles and prefabs.
In words, the TSceneList describes the TScenes to be loaded by TpChunkedSceneManager. Each TScene definition comprises one or more TSceneSpec instances. TSceneSpec instances connect a Selector and its TileFab to a specific TpZoneLayout to use for layout of the Selector’s TileFab.
Your program calls a method in TpChunkedSceneManager to load a TScene based on what’s specified in that specific TScene definition.
TpChunkedSceneManager sets up the load and several callbacks into your code are used to customize exactly what happens.
Selectors, TpZoneLayouts and TpZoneManagers handle almost all of the layout work for you, again, using a few callbacks for customization. TSceneInitializers are Scriptable Object assets that are used to refactor common initialization steps. You add TSceneInitializers to TScene specifications and a default TSceneInitializer to TpZoneLayout components. Using Scene Initializers is optional.
That’s a brief overview.
Creating and editing the SceneList is made simple with the SceneList Editor. You can access this by inspecting a SceneList asset and clicking the EDIT button or with the ChunkedSceneManager component’s EDIT button.