TilePlus Toolkit
Documentation for TilePlus Toolkit, available on the Unity Asset Store.
The information in this book reflects Toolkit Version 5 and newer.
If upgrading from Version 4.X or earlier, please see 'Upgrading' in the "Introduction to TilePlus Toolkit" chapter.
Introduction To TilePlus Toolkit
An introduction to this system
Introduction To TilePlus Toolkit
TilePlus Toolkit (TPT) is a unique way to work with Unity Tilemaps. It’s a Unity extension that ...
Upgrading From Earlier Versions
Upgrading If you're upgrading from Version 4 or earlier and you've been writing custom code using...
Getting Started
If you’re not into coding and want to play with some feature demos, head over to the TilePlus Ext...
Key Elements
New Tile Class The key component of TPT is a new Tile base class cleverly dubbed “TilePlusBase” (...
TpLib Organization
Overview The TilePlus Toolkit base runtime system, generically called "TpLib," is divided into tw...
TpLib
TpLib itself is a large class divided into eight partial classes: TpLib TpLibData TpLibDataAcces...
Editor Library
The Editor Library comprises, well, a whole lot of stuff! Unity menu items The custom Selection ...
Tile+Brush
When using the Unity Tilemap Editor (UTE) you can use the Tile+Brush instead of the default GridB...
Design Philosophy
In an earlier epoch I designed embedded system hardware, software, and development tools in two d...
TilePlusBase
Information about the TilePlusBase class: the basis of this system
Tile+Brush
A different Brush for the Unity Tile Editor. Selection and Brush Inspectors Some information is...
Selection Inspector for Unity tiles
Selection Inspector When displaying a normal Unity tile, the Selection Inspector will look someth...
Selection Inspector for Tile+ tiles
Here’s an example of a Selection Inspector when displaying a TilePlus tile. This is used in Tile+...
Selection Inspector Details
The Basic Info section displays read-only information from the tile. This area changes depending ...
Selection Inspector Toolbar
The Selection Inspector shows this toolbar: Focus: Focus scene view on selected tile. Inspecto...
Brush Inspector
This is the Brush Inspector seen when using the Tile+Brush with the Unity Tile Editor. It looks ...
Other Assets
Specialized Scriptable Object assets
TilePlus Tile Asset Varieties
These are all project-level asssets. TpTileBundle: The asset created when you create a prefab fr...
Animated Tiles
TpAnimatedTile TpAnimatedTile is a simple animated tile and if you want to learn about the code, ...
Special Tiles
TpBundleTile TpBundleTile loads a TileBundle to the Tile's parent Tilemap. TileBundle: a referen...
Tweener Tiles
TweenerFlex This is the best tile to use when experimenting with tweens. When viewed in a TilePlu...
Zone-Based
AnimZoneLoader This class is a subclass of TpFlexAnimated tile and inherits its fields and editor...
UI Tiles
See the UI chapter.
Event and Zone Actions and SubObjects
AnimatorAction Animator Actions are project-level scriptable object plugins. They're only used wi...
Prefabs
TPP_PoolHost Add to a scene to use this as the parent of spawned prefabs. TpTriggerZoneSprites A ...
Components
Monobehaviour components for TilePlus
TpBundleLoader, TpFabLoader
These are components that can be added Tilemap’s GameObject to load TileBundle or TileFab archive...
TpSpawnLink
This component should be attached to any prefab that you use with the SpawningUtil pooling system...
Unity UI and New Input System
Unity UI can invoke methods in monobehaviour targets using Unity events. That's not useful if yo...
Others
Tilemap Parallax Add it to a Tilemap, provide a follow target, and this component offsets the Til...
Services
Dynamically loadable Scriptable Object Services for the TilePlus system
TilePlus Services
Overview In the TilePlus system, Runtime-only Scriptable Objects are called Services or SRS, and ...
Tweener Service
Intro TpTileTweener is a TPT service that can be used for tweening TilePlus tile sprites. The Twe...
Spawner Service
Introduction The TilePlus system uses pooling as much as possible and reasonable. Most of this ac...
Messaging Service
Please see Messages If you're going to use the Messaging Service you need to know about Events. T...
TilePositionDb Service
Introduction The TilePositionDb Service monitors Tilemap callbacks to update a small internal dat...
Messages and Events
TilePlus has two internal messaging systems: Events and Messages
Overview
TilePlus Messaging and Events TpLib has general-purpose messaging and Event functionality. Messag...
Events
Events System Superficially, the Events system implemented by TpEvents seems very simple. A tile ...
Messages
So that's Events. Messages are an entirely different animal. Events is a Static class. Messag...
Zone Actions
Zone Actions are similar to Event Actions but they're not automatically invoked in the same way a...
Runtime Utilities
Various Utilities
Diagnostics
Diagnostic tools for TilePlus
System Information
The Tools/TilePlus/System Info menu command opens UIElements inspector that has a multitude of in...
Services Inspector
The Services Inspector is a UIElements-based window that can be opened with the Tools/TilePlus/Se...
Tween Monitor
The Tween monitor displays information about all running tweens. It's handy to use when creating ...
Position DB Dump
The menu command: Tools/TilePlus/Utilities/Dump PositionDB doesn't open a window. Instead, it dum...
TileFabs and Bundles
Introduction
You probably work with Tilemaps that are part of a scene. This is the easiest way to use TilePlus...
Why Not Make Prefabs
It's a bad solution When you create a prefab by dragging a Grid with child Tilemaps to the Projec...
Bundling Workflow
To make a compatible prefab: Use the Grid Selection mode of TilePlus Painter OR Select a Grid ...
Details
As mentioned before, TpTileBundle (Bundle) assets are used to archive all or a section of a Tilem...
Notes
Other Uses for Bundled Tilemaps When using Tile+Painter, Bundle assets and TileFabs appear in the...
TileFabLib, ZoneManagers, and Layout
Exposition
A TileFab can encompass all the tiles and Prefabs contained within a Tilemap hierarchy (Grid with...
Infrastructure
Review Bundle: an archive of all the tiles and Prefabs for a single Tilemap. TileFab: references ...
TileFabLib
TileFabLib.LoadTileFab loads the Bundles referenced by a TileFab asset. The TileFab asset has ref...
Grid Selections
One might recall from the User Guide that you can create TileFabs and Bundles using a Grid Select...
TpZoneManager
TpZoneManager is a chunk management subsystem. Your code interacts with instances of the TpZoneMa...
The Super-Grid
When you initialize a ZM with a chunk size and world origin you’re defining a higher-dimension or...
Useful Methods, Camera Projection, Notes
The GetLocator methods allow you to also pass in a Vector2Int dimensions parameter. This lets you...
TpZoneLayout
At an even higher level, the TpZoneLayout MonoBehaviour component leverages a ZM to implement a b...
Layout System : Introduction
TilePlus Toolkit’s Layout system was changed in Versions 4 and 5. It’s more memory efficient and ...
Layout System Nomenclature
Name Class Type Use TileFabLib Static Loads TileFabs, supervises ZoneManager instances. ...
Preparing a TScene
Now, how do you create a TileFab for use with this system? You create a TScene in a Unity scene t...
Scene List Editor
Now that you have a TSceneList asset, let's edit it. Examine the asset in an inspector and click ...
Relationships: Chunksize, Padding, Selector
This system is flexible, but it is easy to make mistakes. If you have the chunk size set too larg...
At Runtime...
During your Unity scene initialization you can load the first TScene by calling TpChunkedSceneMan...
Layout System Block Diagram
This block diagram illustrates the main parts of the chunking system. The lowest-level APIs are ...
TSceneList
Each TSceneList asset comprises information about one or more TScenes (Tile Scenes). These are sh...
TpZoneLayout
You may have noticed in TSceneList that each TScene can have multiple TSceneSpecs. What’s that fo...
Using Multiple ZoneLayouts
This is a really useful feature. You might have a Tilemap Group comprising a Grid with, say, 8 ch...
Zones and LoadFlags
Zones A Zone is a square area of a Tilemap which is internally represented by a RectInt. The X an...
Selectors
Selectors are used by the layout system to determine what and how to load. Each Selector has a re...
TSceneInitializer
You use one of the SetScene overloads of ChunkedSceneManager to change TScenes. The very last thi...
About the Layout Demo
Save Files There are two different types of save files: CdemoSaveFile.txt: contains the GUID of ...
Using PositionDb Service with Layout
The TilePositionDb is a Scriptable Runtime Service: it’s an optional feature that you can use to ...
Interfaces
ITilePlus
This is the main interface for TilePlus tiles. Almost all of the interface is implemented in Tile...
ITpMessaging
ITpMessaging is used to implement targets for the Messaging Service. It's pretty simple: /// <sum...
ITpPersistence
This interface specifies endpoints for save and restore data. It's something optional and a bit l...
Layout-Related
ITSceneInitializer Scene Initializers are used as a way to move scene initialization code into Sc...
Others
These are mostly for internal use. IActionPlugin Used with ZoneActions and EventActions to provid...
Attributes
TilePlus Script Attributes
If you’ve done any Unity coding then you’re probably familiar with Attributes by now, such as tho...
Common Parameters
Common Parameters These parameters apply to all Attributes except TptShowAsLabelBrushInspector. ...
Notes
The [TppShowAsLabel…] attributes allow you to display a property. This can be useful in many ways...
Persistence
Create Your Own
Create new TilePlus tiles
Basics
In most cases, the class that you want to subclass is TilePlusBase. But you might want to extend ...
Properties
Why so many properties? Fewer serialized fields for things that are just basically boolean switch...
Methods
Simulate can be implemented to use the Editor update event to do something. In TpAnimatedTile and...
Namespaces and Interfaces
Namespaces The GUI formatter for the Brush and Selection inspectors displays information in class...
Ui System
Technical Notes
Miscellaneous Information for delvers
Why Use New GUIDs?
If you want to load the same TileFab multiple times programmatically you need to set the newGuids...
Preparing for Builds
When using ZoneManager and ZoneLayout, you need to ensure that the referenced TileFabs are correc...
Limitations
Code Changes Changing code in subclasses may result in missing references in already-placed clone...
TpLibInit and TpLib Memory allocation
The static library TpLib.cs has several Dictionaries that keep track of all TPT tiles. The initia...
Lifetime of a TilePlus tile
TilePlus lets you treat a Tile script much like a script attached to a GameObject: but Tiles are ...
Inhibiting Callbacks
For performance reasons you might want to temporarily inhibit TpLib from responding to certain Ti...