Skip to main content

TpLib

TpLib itself is a large class divided into eight partial classes:

  • TpLib
  • TpLibData
  • TpLibDataAccess
  • TpLibPools
  • TpLibScene
  • TpLibTasks
  • TpLibTiming

And in an Editor folder

  • TpLibEditorUtils

If you're coding to the TpLib API, the parts you'd most likely be interested in are TpLibDataAccess and TpLibTasks. Complete information can be found in the API reference (a zip file in the TilePlusExtras folder).

TpLibDataAccess

The methods in TpLibDataAccess have pre-built 'queries' that allow you to extract information from the TMDB, which are data loaded into various structures in the TpLibData section of TpLib such as Types, Interfaces, Tags, GUIDs, etc.

There is also functionality for complex operations:

  • Cut And Paste: Move a TPT tile from one positionn to another.
  • Copy And Paste: Copy a TPT tile and place the copy elsewhere.
    • This should always be used for this sort of operation so that the cloned tiles are copied correctly.

Queries

Please consult the API reference for complete information. Not every variation is shown below.

GetAllTilesInRegionForMap: load all TPT tiles within a RectInt region into a provided List.

GetAllTiles<T>: load all TPT tiles of Type T in all Tilemaps into a provided list, with filtering callback.

GetAllTilesOfType

GetAllTilesWithInterface<T>

GetTilesWithTag

GetFirstTileWithTag

GetTilePlusBaseFromGuid