A specialized ChunkSelector that uses the Chunkified data in Bundles to fill in empty areas in the ZoneLayout.
More...
|
| override bool | Initialize (TpZoneManager zm, object? obj=null) |
| | Initialization.- Parameters
-
| zm | The Zone Manager this Selector is using |
| obj | Arbitrary data |
- Returns
true if XXXX, false otherwise.
|
| override TileFabLoadParams | Selector (RectInt locator, TpZoneLayout layout, Dictionary< string, Tilemap > monitoredMaps) |
| | Obtain TileFab load params given a locator.
|
| override bool | Release () |
| | Release memory in the TileFab and its bundles.
|
| void | OnDisable () |
| | Unity event handler.
|
| override BoundsInt | SelectorTotalSize (TpZoneLayout layout) |
| | selectorTotalSize BoundsInt defines the size of a single complete image ie the entirety of the template's TileFabs. by default this is placed in Quadrant 1 of a 2D plane whose origin is at m_Layout.m_WorldOrigin and the size is always a square.
|
| override List< TemplateSelectorQueryResults< T > > | GetTilePlusTilesOfType< T > (Func< T, string, bool >? filter=null, int size=16, object? options=null) |
| | —A GENERIC METHOD— Access ALL the TileFab's bundles to create a list of a particular type of TPT tile, with filtering. Intended to be used during a scene or game init as this can take a while, depending on how many bundles are in the TileFab and how many TPT tiles are in each bundle.
|
| virtual void | OnEnable () |
| | OnEnable handler: add a GUID if not present. Typically this occurs when the SO is created from Unity's Create Asset menu.
|
| void | AddGuid () |
| | Add/Change GUID for this asset.
|
A specialized ChunkSelector that uses the Chunkified data in Bundles to fill in empty areas in the ZoneLayout.
◆ GetTilePlusTilesOfType< T >()
| override List< TemplateSelectorQueryResults< T > > TilePlus.TpChunkZoneSelector.GetTilePlusTilesOfType< T > |
( |
Func< T, string, bool >? | filter = null, |
|
|
int | size = 16, |
|
|
object? | options = null ) |
|
virtual |
—A GENERIC METHOD— Access ALL the TileFab's bundles to create a list of a particular type of TPT tile, with filtering. Intended to be used during a scene or game init as this can take a while, depending on how many bundles are in the TileFab and how many TPT tiles are in each bundle.
- Parameters
-
| options | Optional object for custom implementations. |
| filter | optional filter using the tile ASSET and name of Tilemap as input params, returning a bool. If that bool is false then the tile is excluded from the method's output. |
| size | optional initial allocated size of returned list |
- Template Parameters
-
- Returns
- List of TemplateSelectorQueryResults
retrieves TilePlus tiles ONLY. It's important to note that:
- the tile returned is a locked TilePlus tile ASSET in the PROJECT and not an INSTANCE in the scene. 1.A. So don't mess with it. Reading the contents of fields is A-OK.
- Only the string name of the Tilemap (as preserved in the TileFab) is available.
- The bundles aren't unarchived, the locked TilePlus tile assets are examined directly, which is why one sees expressions like item.m_TilePosition.m_Position.
- In general it's a bad idea to maintain references to these tiles; doing so will cause a memory leak. So don't cache the TemplateSelectorQueryResults outside of the calling method.
Reimplemented from TilePlus.TpChunkSelectorBase.
◆ Initialize()
| override bool TilePlus.TpChunkZoneSelector.Initialize |
( |
TpZoneManager | zm, |
|
|
object? | obj = null ) |
|
virtual |
Initialization.
- Parameters
-
| zm | The Zone Manager this Selector is using |
| obj | Arbitrary data |
- Returns
true if XXXX, false otherwise.
Reimplemented from TilePlus.TpChunkSelectorBase.
◆ OnDisable()
| void TilePlus.TpChunkZoneSelector.OnDisable |
( |
| ) |
|
◆ Release()
| override bool TilePlus.TpChunkZoneSelector.Release |
( |
| ) |
|
|
virtual |
◆ Selector()
| override TileFabLoadParams TilePlus.TpChunkZoneSelector.Selector |
( |
RectInt | locator, |
|
|
TpZoneLayout | layout, |
|
|
Dictionary< string, Tilemap > | monitoredMaps ) |
|
virtual |
Obtain TileFab load params given a locator.
- Parameters
-
| locator | The Locator. |
| layout | The Zone Layout instance. |
| monitoredMaps | Tilemaps used by the ZoneManager. |
- Returns
- TileFab load params
Reimplemented from TilePlus.TpChunkSelectorBase.
◆ SelectorTotalSize()
| override BoundsInt TilePlus.TpChunkZoneSelector.SelectorTotalSize |
( |
TpZoneLayout | layout | ) |
|
|
virtual |
selectorTotalSize BoundsInt defines the size of a single complete image ie the entirety of the template's TileFabs. by default this is placed in Quadrant 1 of a 2D plane whose origin is at m_Layout.m_WorldOrigin and the size is always a square.
- Parameters
-
- Returns
- BoundsInt
Reimplemented from TilePlus.TpChunkSelectorBase.
◆ m_ClearFabCache
| bool TilePlus.TpChunkZoneSelector.m_ClearFabCache = true |
Auto clear this Fab's cache when the selector isn't used anymore.
◆ m_TileFabSource
| TpTileFab? TilePlus.TpChunkZoneSelector.m_TileFabSource = null |
◆ AllLocators
| List<RectInt>? TilePlus.TpChunkZoneSelector.AllLocators |
|
get |
Get all of the locators for this Selector.
◆ UsedTileFabs
| override List<TpTileFab> TilePlus.TpChunkZoneSelector.UsedTileFabs |
|
get |
The documentation for this class was generated from the following file:
- /Users/jms/Documents/Tpt_55/TPT55/Assets/Plugins/TilePlus/Runtime/AssetScripts/Chunking/TpChunkZoneSelector.cs