TpLib Organization
Overview
The TilePlus Toolkit base runtime system, generically called "TpLib," is divided into two groups of code. This is a block diagram of the core software. Dashed lines are inheritance, solid lines are dependencies.
Static classes
- These are static because they are required for editing support, or have low impact on domain reloading, or are required immediately in a built-app or when switching to Play mode in the Editor.
- TpLib: The enabling and underlying library. Implements a Tilemap DataBase (TMDB) and queries, and provides update 'ticks' for various system functions.
- TpZoneManagerLib: Editing support and Tile+Painter.
- TpServiceManager: small and required immediately in Play mode.
- TileFabLib: API for loading Tilefabs and managing ZoneManagers (Layout system). Needed for both Edit and Play/Build use.
- TpTileUtils: small utility library, improper as service.
- TpEvents: small, required immediately in Play mode.
Generally, these have to be present after a domain reload and are required for edit support for the Tile+Brush, TilePlusPainter, etc. Where possible, their domain reload time is minimized by:
- Lazy initialization of arrays and lists
- Simple 'InitializeOnLoad' methods.
- Small memory allocations
- Overrideable with a project-level scriptable object for runtime initialization.
Scriptable Runtime Services
In this documentation these are often referred to as SRS. SRS are dynamically-loadable Scriptable Objects designed for independent services like those shown below or for any you create.
There's a simple base-class for these that you can use to create your own and add them to the system-level Service Manager.
These are runtime-only. They aren't needed for edit support and would impact domain reload time for various reasons, or perhaps you don't actually want to use all of these extra features.
- TpTileTweener: a tweener for tile sprites
- TpSpawner: pooled spawner
- TpMessaging: Monobehaviour-to-tile or tile-to-tile messaging.
- TpTilePositionDb: keeps track of occupied positions on specified Tilemaps.
Please see the Services section for more info.