Rotorz Tile System Icon
Rotorz Tile System for Unity
API Reference
Available on the Unity Asset Store
TOC

TileSystem Class

Main tile system component which allows you to interact with a tile system using runtime or editor scripts.
public sealed class TileSystem : MonoBehaviour, 
	ISerializationCallbackReceiver
public sealed class TileSystem extends MonoBehaviour
	implements ISerializationCallbackReceiver

For further information regarding the usage of tile systems refer to Tile Systems section of the user guide.

Methods

BeginBulkEdit()
Begins bulk painting and/or erasing of tiles.
CalculateCellSizeScale(Int32)
Calculate vector which can be used to scale an object by CellSize whilst taking simple rotations into consideration.
CalculateSimpleRotation(Int32)
Calculate rotational offset to tile and orientate to face away from tile system according to the value of TilesFacing.
CalculateSimpleRotation(TileFacing, Int32)
Calculate rotational offset to tile and orientate to face away from tile system according to a specified value of TileFacing.
CalculateTileMatrix(Matrix4x4, Int32)
Calculate matrix which can be used to rotate a tile to face away from the system according to the value of TilesFacing.
CalculateTileMatrix(Matrix4x4, TileFacing, Int32)
Calculate matrix which can be used to rotate a tile to face away from the system according to a specified value of TileFacing.
CalculateTileMatrix(Matrix4x4, Int32, Int32, Int32, Boolean)
Calculate matrix which can be used to position a tile within its cell and rotate it to face away from the system according to the value of TilesFacing.
CalculateTileMatrix(Matrix4x4, Int32, Int32, TileFacing, Int32, Boolean)
Calculate matrix which can be used to rotate a tile to face away from the system according to a specified value of TileFacing.
ChunkIndexFromTileIndex(TileIndex)
Calculate chunk index from tile index.
ChunkIndexFromTileIndex(Int32, Int32)
Calculate chunk index from tile index.
ClosestTileIndexFromRay(Ray)
Index of closest tile from ray.
ClosestTileIndexFromWorld(Vector3)
Index of closest tile from ray.
CountNonEmptyTiles()
Counts the number of non-empty tiles.
CreateSystem(Single, Single, Single, Int32, Int32, Int32, Int32)
Creates the tile system with specified number of rows and columns.
EndBulkEdit()
Ends bulk painting and/or erasing of tiles.
EraseAllTiles()
Erases all tiles.
EraseTile(TileIndex)
Erase a specific tile.
EraseTile(Int32, Int32)
Erase a specific tile.
GetChunk(Int32, Int32)
Gets chunk component at row and column.
GetChunkFromTileIndex(TileIndex)
Gets chunk component from a tile index.
GetChunkFromTileIndex(Int32, Int32)
Gets chunk component from a tile index.
GetTile(TileIndex)
Gets data of tile at row and column.
GetTile(Int32, Int32)
Gets data of tile at row and column.
GetTileOrNull(TileIndex)
Gets data of tile at row and column but doesn't throw any exceptions.
GetTileOrNull(Int32, Int32)
Gets data of tile at row and column but doesn't throw any exceptions.
InBounds(TileIndex)
Determines whether the specified tile index is within bounds of the tile system.
InBounds(Int32, Int32)
Determines whether the specified tile index is within bounds of the tile system.
IndexOfTileInChunk(TileIndex)
Gets index of tile at row and column in relevant chunk.
IndexOfTileInChunk(Int32, Int32)
Gets index of tile at row and column in relevant chunk.
IsSolid(TileIndex)
Determines whether specific tile is flagged as being solid.
IsSolid(Int32, Int32)
Determines whether specific tile is flagged as being solid.
LocalPositionFromTileIndex(TileIndex, Boolean)
Calculate position of tile in coordinates local to tile system.
LocalPositionFromTileIndex(Int32, Int32, Boolean)
Calculate position of tile in coordinates local to tile system.
RefreshAllTiles(RefreshFlags)
Refresh all tiles in system.
RefreshSurroundingTiles(TileIndex)
Refresh tiles that surround a specific tile.
RefreshSurroundingTiles(Int32, Int32)
Refresh tiles that surround a specific tile.
RefreshSurroundingTiles(TileIndex, RefreshFlags)
Refresh tiles that surround a specific tile.
RefreshSurroundingTiles(Int32, Int32, RefreshFlags)
Refresh tiles that surround a specific tile.
RefreshTile(TileIndex, RefreshFlags)
Refresh a specific tile using its original brush.
RefreshTile(Int32, Int32, RefreshFlags)
Refresh a specific tile using its original brush.
ReplaceByBrush(Brush, Brush)
Replaces all tiles that were painted using a specific brush.
ScanBrokenTiles(RepairAction, Boolean)
Count and/or repair broken tiles.
SetTile(TileIndex, TileData)
Set contents of tile at specified row and column. Associated game object is erased if tile already exists.
SetTile(Int32, Int32, TileData)
Set contents of tile at specified row and column. Associated game object is erased if tile already exists.
SetTileFrom(TileIndex, TileData)
Set contents of tile at specified row and column from existing tile data. Associated game object is erased if tile already exists.
SetTileFrom(Int32, Int32, TileData)
Set contents of tile at specified row and column from existing tile data. Associated game object is erased if tile already exists.
TileTrace(Brush, TileTraceDirection, TileIndex, TileTraceHit)
Trace through tiles horizontally or vertically to find first tile that was painted using a specific brush.
TileTrace(Brush, TileTraceDirection, Int32, Int32, TileTraceHit)
Trace through tiles horizontally or vertically to find first tile that was painted using a specific brush.
TileTrace(TileTraceDirection, Int32, Int32, TileTraceHit, TileTraceDelegate)
Trace through tiles horizontally or vertically to find first tile that is found using custom delegate.
TileTrace(Int32, Int32, Int32, Int32, TileTraceHit, TileTraceDelegate)
Trace through tiles horizontally or vertically to find first tile that is found using custom delegate.
TileTraceBrush(Brush, TileIndex, TileIndex, TileTraceHit)
Trace through tiles from origin to destination to find first tile that was painted using a specific brush.
TileTraceBrush(Brush, Int32, Int32, Int32, Int32, TileTraceHit)
Trace through tiles from origin to destination to find first tile that was painted using a specific brush.
TileTraceFlags(Int32, TileIndex, TileIndex, TileTraceHit)
Trace through tiles from origin to destination to find first tile that has all required flags.
TileTraceFlags(Int32, TileTraceDirection, TileIndex, TileTraceHit)
Trace through tiles horizontally or vertically to find first tile that has all required flags.
TileTraceFlags(Int32, TileTraceDirection, Int32, Int32, TileTraceHit)
Trace through tiles horizontally or vertically to find first tile that has all required flags.
TileTraceFlags(Int32, Int32, Int32, Int32, Int32, TileTraceHit)
Trace through tiles from origin to destination to find first tile that has all required flags.
TileTraceSolid(TileIndex, TileIndex, TileTraceHit)
Trace through tiles from origin to destination to find first tile that is flagged as solid.
TileTraceSolid(TileTraceDirection, TileIndex, TileTraceHit)
Trace through tiles horizontally or vertically to find first tile that is flagged as solid.
TileTraceSolid(TileTraceDirection, Int32, Int32, TileTraceHit)
Trace through tiles horizontally or vertically to find first tile that is flagged as solid.
TileTraceSolid(Int32, Int32, Int32, Int32, TileTraceHit)
Trace through tiles from origin to destination to find first tile that is flagged as solid.
UpdateProceduralTiles(Boolean)
Update procedural meshes from tile data.
WorldPositionFromTileIndex(TileIndex, Boolean)
Calculate position of tile in world coordinates.
WorldPositionFromTileIndex(Int32, Int32, Boolean)
Calculate position of tile in world coordinates.

Fields

addProceduralNormals
Indicates if normals should be added to procedurally generated meshes.
applyRuntimeStripping
Indicates if reduced level of stripping should be applied at runtime.
combineChunkHeight
The height of a tile chunk to combine (in tiles).
combineChunkWidth
The width of a tile chunk to combine (in tiles).
combineIntoSubmeshes
Indicates whether tile meshes should be combined into submeshes when they contain multiple materials. Disable to create individual mesh objects on a per-material basis.
combineMethod
Method of combining to perform upon build.
generateSecondUVs
Indicates if second set of UVs should be automatically generated for static tiles during build.
hintEraseEmptyChunks
Hints if empty chunks should be automatically removed.
pregenerateProcedural
Indicates if tiles that are procedurally generated should be pre-generated when building tile system.
sceneOrder
Order of tile system in "RTS: Scene" editor window.
staticVertexSnapping
Indicates if vertex snapping should be applied during build process.
updateProceduralAtStart
Indicates whether procedural meshes should be updated when tile system becomes active.
vertexSnapThreshold
Vertices are automatically snapped and smoothed within given threshold. Default is usually recommended but can be disabled with zero.

Properties

BulkEditMode
Gets a value indicating whether this TileSystem is in bulk edit mode.
CellSize
Gets or sets size of cell within system.
ChunkColumns
Gets the number of columns of chunks.
ChunkHeight
Gets the height of a chunk (number of tiles).
ChunkRows
Gets the number of rows of chunks.
Chunks
Gets list of available chunk components.
ChunkWidth
Gets the width of a chunk (number of tiles).
ColumnCount
Gets count of columns in tile system.
IsBuilt
Gets a value indicating whether tile system has been built.
IsEditable
Gets a value indicating whether this TileSystem is editable.
IsEndingBulkEditMode
Gets a value indicating whether changes made during bulk edit mode are being finalized. The value of this property is occassionally useful in the context of painting and refreshing tiles.
Locked
Gets or sets whether tile system is locked and shouldn't be edited.
MarkProceduralDynamic
Gets or sets a value indicating whether procedurally generated meshes are likely to be updated throughout play where tiles are painted and/or erased frequently to improve performance (this may use more memory).
Plane
Gets mathematical plane representation of tile system.
ReduceColliders
Often box colliders of tiles painted using static brushes can be reduced. This field indicates whether such colliders should be reduced when building tile system.
RowCount
Gets count of rows in tile system.
SortingLayerID
Gets or sets identifier of sorting layer which is used to control render order of procedurally generated meshes.
SortingOrder
Gets or sets order in sorting layers which is used to control render order of procedurally generated meshes.
StripBrushReferences
Gets or sets a value indicating whether brush references should be stripped at runtime or when performing build.
StripChunkMap
Gets or sets a value indicating whether chunk map should be stripped at runtime or when performing build.
StripChunks
Gets or sets a value indicating whether chunk game objects should be stripped when performing build.
StripCombinedEmptyObjects
Gets or sets a value indicating whether empty game objects leftover after mesh combine should be stripped.
StripEmptyChunks
Gets or sets a value indicating whether empty chunk game objects should be stripped when performing build.
StripEmptyObjects
Gets or sets a value indicating whether empty game objects should be stripped when performing build.
StrippingOptions
Gets or sets stripping options.
StrippingPreset
Gets or sets stripping preset.
StripPlopComponents
Gets or sets a value indicating whether plop instance and group components should be stripped from plopped tiles.
StripSystemComponent
Gets or sets a value indicating whether this TileSystem component should be stripped at runtime or when performing build.
StripTileData
Gets or sets a value indicating whether tile data should be stripped at runtime or when performing build.
TilesFacing
Gets or sets the direction in which painted tiles will face.
transform
Gets cached transform component for tile system.

Inheritance Hierarchy

System.Object
  Object
    Component
      Behaviour
        MonoBehaviour
          Rotorz.Tile.TileSystem

See Also

Reference