An asset used to bundle-up tiles for later re-creation. Since Transforms, Colors, and Flags values are often the same, those are indexed to save space. Note this is a partial class.
More...
|
| TileChangeData[] Dictionary< Vector3Int, string > dict | TilesetChangeData (TilemapRotation rotation, Vector3Int offset, FabOrBundleLoadFlags loadFlags, Func< FabOrBundleFilterType, BoundsInt, object, bool >? filter=null) |
| List< TilesetItem > | Tileset (TilemapRotation rotation, FabOrBundleLoadFlags loadFlags, Func< FabOrBundleFilterType, BoundsInt, object, bool >? filter=null) |
| | Get an array of TilesetItem instances with all the information that's needed to populate a Tilemap with the tiles contained in the asset.
|
| bool | Chunkify (TpZoneLayout layout) |
| | Break up this bundle into chunks. Assumption is that this bundle is from a grid selection so all of the BoundsInts are the same: same value and all are power of two aligned and square in size.
|
| bool | LoadCachedTileChangeData (RectInt locator, Tilemap map) |
| | Get a set of TileChangeData for a particular locator (offset = locator.position) and load it to a tilemap.
|
| void | GetAllPositions (List< Vector3Int > output) |
| | Get an array of all positions used by this bundle. NOTE that these are relative positions and NOT actual tilemap positions.
|
| void | ClearCache (bool alsoClearLastCompleteTileset=false) |
| | Clear the Unity tiles' cache v4.1+ also optionally clears lastCompleteTileset.
|
| bool | AddGuid () |
| | Add a GUID to this asset. Only works once.
|
| TilePlusBase | FindMatchingTpTile (Vector3Int position) |
| | Find the TilePlus tile for a position.
|
| TileBase? | FindMatchingUnityTile (Vector3Int position) |
| | Find the Unity tile for a position.
|
| void | GenerateInitialData () |
| | Generate initial JSON GUID-SaveData sets. Note that this only applies to use of SaveDataWrapper and StringPacket.
|
|
| float | ElapsedTime [get] |
| | Elapsed time for the Chunkify process.
|
| bool | IsChunkified [get] |
| | is this tilefab chunkified?
|
| List< TilesetItem > | UnityTileCache [get] |
| | Get the current cache of Unity tiles. This may have been affected by filtering.
|
| List< TilesetItem >? | LastCompleteTileset [get] |
| | Get the last complete Tileset created by Tileset. May have been affected by filtering.
|
| Guid | BundleGuid [get] |
| | Get the asset's GUID as a GUID struct.
|
| bool | Valid [get] |
| | Returns true if this asset was sealed. That's determined by checking to see if m_TileFlags != null, since if Seal was never called then that field would be null.
|
| bool | EmptyBundle [get] |
| | Returns true if this bundle has no tiles or prefabs.
|
| string | AssetGuidString [get] |
| | Get a string representation of the GUID.
|
| byte | AssetVersion [get] |
| | Gets the asset version.
|
| string | CacheState [get] |
| | Display cache state.
|
| bool | CacheForceFilter [get, set] |
| | Set true to force the U-tiles cache to use a provided filter. THE VALUE IF THIS PROPERTY IS CLEARED AFTER THE NEXT USE OF TileSet() or TileSetChangeData.
|
An asset used to bundle-up tiles for later re-creation. Since Transforms, Colors, and Flags values are often the same, those are indexed to save space. Note this is a partial class.
Version 2 adds GUIDs
◆ TilemapRotation
Enum of rotation types.
| Enumerator |
|---|
| Zero | No rotation.
|
| Ninety | 90 degrees rotation
|
| OneEighty | 180 degrees rotation
|
| TwoSeventy | 270 degrees rotation
|
◆ AddGuid()
| bool TilePlus.TpTileBundle.AddGuid |
( |
| ) |
|
Add a GUID to this asset. Only works once.
- Returns
- true if the GUID was added, false if there already was a GUID
◆ Chunkify()
Break up this bundle into chunks. Assumption is that this bundle is from a grid selection so all of the BoundsInts are the same: same value and all are power of two aligned and square in size.
- Parameters
-
◆ ClearCache()
| void TilePlus.TpTileBundle.ClearCache |
( |
bool | alsoClearLastCompleteTileset = false | ) |
|
Clear the Unity tiles' cache v4.1+ also optionally clears lastCompleteTileset.
◆ FindMatchingTpTile()
| TilePlusBase TilePlus.TpTileBundle.FindMatchingTpTile |
( |
Vector3Int | position | ) |
|
Find the TilePlus tile for a position.
- Parameters
-
- Returns
- Tile instance or null if not found
◆ FindMatchingUnityTile()
| TileBase? TilePlus.TpTileBundle.FindMatchingUnityTile |
( |
Vector3Int | position | ) |
|
Find the Unity tile for a position.
- Parameters
-
- Returns
- the tile instance or null if not found
◆ GenerateInitialData()
| void TilePlus.TpTileBundle.GenerateInitialData |
( |
| ) |
|
◆ GetAllPositions()
| void TilePlus.TpTileBundle.GetAllPositions |
( |
List< Vector3Int > | output | ) |
|
Get an array of all positions used by this bundle. NOTE that these are relative positions and NOT actual tilemap positions.
Note that any filtering or caching does not affect the return value. It is solely based on what's in the Bundle.
◆ LoadCachedTileChangeData()
| bool TilePlus.TpTileBundle.LoadCachedTileChangeData |
( |
RectInt | locator, |
|
|
Tilemap | map ) |
Get a set of TileChangeData for a particular locator (offset = locator.position) and load it to a tilemap.
- Parameters
-
| locator | the locator |
| map | target TileMap |
- Returns
- false if an error.
◆ Tileset()
Get an array of TilesetItem instances with all the information that's needed to populate a Tilemap with the tiles contained in the asset.
- Parameters
-
| rotation | Rotation (unimplemented) |
| filter | a Func returning a bool. |
| loadFlags | Control Flags. See TileFabLib |
- Returns
- List<TilesetItem>.
◆ TilesetChangeData()
◆ data
| TileChangeData [] TilePlus.TpTileBundle.data |
Get TileChangeData from the Bundle's TileSet.
- Parameters
-
| rotation | |
| offset | The offset to use for normalizing positions if this Bundle is from a grid selection. |
| loadFlags | control flags. See TileFabLib |
| filter | Func returning a bool |
- Returns
- Tuple with TileChangeData array and position->GUID dictionary. Note it's possible for the dict to have null entries if there are no TPT tiles
◆ m_FromGridSelection
| bool TilePlus.TpTileBundle.m_FromGridSelection |
set true if this bundle was created from a GridSelection rather than an entire tilemap.
◆ m_Icon
| Sprite? TilePlus.TpTileBundle.m_Icon |
Added in V3. A representative sprite. Painter will display this UNLESS it's packed in an atlas.
◆ m_IgnoreInPainter
| bool TilePlus.TpTileBundle.m_IgnoreInPainter |
Set true if Painter should not show this in its Palettes list.
◆ m_OriginalScene
| string TilePlus.TpTileBundle.m_OriginalScene = string.Empty |
The original scene this was created from.
◆ m_PersistableGuids
| string? [] TilePlus.TpTileBundle.m_PersistableGuids |
The set of TPT tile GUIDs for this bundle.
◆ m_PersistableJson
| string? [] TilePlus.TpTileBundle.m_PersistableJson |
The set of TPT tile JSON: the preserved state.
◆ m_Prefabs
| List<PrefabItem> TilePlus.TpTileBundle.m_Prefabs = new() |
The prefabs for this tilemap.
◆ m_ScenePath
| string TilePlus.TpTileBundle.m_ScenePath = string.Empty |
The scene path when this asset was created.
◆ m_TileColors
| Color? [] TilePlus.TpTileBundle.m_TileColors |
An array of indexed tile colors.
◆ m_TileFlags
| TileFlags? [] TilePlus.TpTileBundle.m_TileFlags |
An array of indexed tile flags.
◆ m_TilemapBoundsInt
| BoundsInt TilePlus.TpTileBundle.m_TilemapBoundsInt |
The bounds int for this tilemap.
◆ m_TilePlusTiles
| List<TilePlusItem> TilePlus.TpTileBundle.m_TilePlusTiles = new() |
The tileplus tiles for this tilemap.
◆ m_TileTransforms
| Matrix4x4? [] TilePlus.TpTileBundle.m_TileTransforms |
An array of indexed tile transforms.
◆ m_TimeStamp
| string? TilePlus.TpTileBundle.m_TimeStamp |
The timestamp for this asset.
◆ m_TotalChunkedTtiles
| int TilePlus.TpTileBundle.m_TotalChunkedTtiles |
If Chunkified, this is total number of TPT tiles in the fabZoneToCachedUtileMap.
◆ m_TotalChunkedUtiles
| int TilePlus.TpTileBundle.m_TotalChunkedUtiles |
If Chunkified, this is total number of Unity tiles in the fabZoneToCachedUtileMap.
◆ m_UnityTiles
The Unity tiles for this tilemap.
◆ m_UserFlag
| bool TilePlus.TpTileBundle.m_UserFlag |
Arbitrary boolean for use when filtering layouts.
◆ m_UserString
| string TilePlus.TpTileBundle.m_UserString = string.Empty |
Arbitrary string for use when filtering layouts.
◆ AssetGuidString
| string TilePlus.TpTileBundle.AssetGuidString |
|
get |
Get a string representation of the GUID.
◆ AssetVersion
| byte TilePlus.TpTileBundle.AssetVersion |
|
get |
Gets the asset version.
The asset version.
◆ BundleGuid
| Guid TilePlus.TpTileBundle.BundleGuid |
|
get |
Get the asset's GUID as a GUID struct.
The unique identifier.
◆ CacheForceFilter
| bool TilePlus.TpTileBundle.CacheForceFilter |
|
getset |
Set true to force the U-tiles cache to use a provided filter. THE VALUE IF THIS PROPERTY IS CLEARED AFTER THE NEXT USE OF TileSet() or TileSetChangeData.
Also clears the cache for you.
◆ CacheState
| string TilePlus.TpTileBundle.CacheState |
|
get |
Display cache state.
string
◆ ElapsedTime
| float TilePlus.TpTileBundle.ElapsedTime |
|
get |
Elapsed time for the Chunkify process.
◆ EmptyBundle
| bool TilePlus.TpTileBundle.EmptyBundle |
|
get |
Returns true if this bundle has no tiles or prefabs.
◆ IsChunkified
| bool TilePlus.TpTileBundle.IsChunkified |
|
get |
is this tilefab chunkified?
◆ LastCompleteTileset
| List<TilesetItem>? TilePlus.TpTileBundle.LastCompleteTileset |
|
get |
Get the last complete Tileset created by Tileset. May have been affected by filtering.
◆ UnityTileCache
Get the current cache of Unity tiles. This may have been affected by filtering.
◆ Valid
| bool TilePlus.TpTileBundle.Valid |
|
get |
Returns true if this asset was sealed. That's determined by checking to see if m_TileFlags != null, since if Seal was never called then that field would be null.
Updated in 2.1 to include a check for no prefabs. Permits use of prefab-only bundles.
The documentation for this class was generated from the following files:
- /Users/jms/Documents/Tpt_55/TPT55/Assets/Plugins/TilePlus/Runtime/AssetScripts/Bundles/TpTileBundle.cs
- /Users/jms/Documents/Tpt_55/TPT55/Assets/Plugins/TilePlus/Runtime/AssetScripts/Bundles/TpTileBundleData.cs