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

AutotileBrush Class

Autotile brushes make it easier for artists to design 2D tiles that connect with one another. This type of brush is particularly useful for creating things like walls, paths, platforms, etc.
public sealed class AutotileBrush : TilesetBrush, 
	ICoalescableBrush
public sealed class AutotileBrush extends TilesetBrush
	implements ICoalescableBrush

Refer to Autotile Brushes section of user guide for further information.

Methods

ApplyTransforms(IBrushContext, TileData, Brush)
Apply transforms to newly painted tile and orientate against tile system.
(Inherited from TilesetBrush.)
Awake()
Invoked when brush first becomes active.
(Overrides Brush.Awake().)
CalculateManualOffset(IBrushContext, TileData, Transform, Vector3, Quaternion, Vector3, Brush)
Calculates offset from actual tile position and where tile would normally be positioned by brush. This is used to preserve manually tweaked offsets when tiles are refreshed.
(Inherited from TilesetBrush.)
CountTileVariations(Int32)
Count the number of tile variations.
(Inherited from Brush.)
CreateNonProceduralTile(IBrushContext, TileData, Boolean)
Create non-procedural tile.
(Inherited from TilesetBrush.)
CreateProceduralTile(IBrushContext, TileData, Boolean)
Create procedural tile.
(Inherited from TilesetBrush.)
CreateTile(IBrushContext, TileData)
Create visual representation of tile.
Cycle(TileSystem, TileIndex, Int32)
Cycle through tile variations.
(Inherited from Brush.)
Cycle(TileSystem, Int32, Int32, Int32)
Cycle through tile variations.
(Inherited from Brush.)
CycleWithSimpleRotation(TileSystem, TileIndex, Int32, Int32)
Cycle through tile variations and/or rotation indices.
(Inherited from Brush.)
CycleWithSimpleRotation(TileSystem, Int32, Int32, Int32, Int32)
Cycle through tile variations and/or rotation indices.
(Inherited from Brush.)
DrawImmediateTilePreview(IBrushContext, Material, TileData, Brush)
Helper method to draw immediate preview of tileset tile.
(Inherited from TilesetBrush.)
GetNthMaterial(Int32)
Gets the nth material from available renderers.
(Inherited from Brush.)
GetTransformMatrix(TileSystem, TileIndex, Int32, Transform)
Gets matrix that describes transformation of tile painted using brush in local space of tile system.
(Inherited from Brush.)
GetTransformMatrix(TileSystem, Int32, Int32, Int32, Transform)
Gets matrix that describes transformation of tile painted using brush in local space of tile system.
(Inherited from Brush.)
GetUserFlag(Int32)
Get state of custom user flag.
(Inherited from Brush.)
OnAfterDeserialize()
See Unity documentation OnAfterDeserialize() for further information regarding this method.
OnBeforeSerialize()
See Unity documentation OnBeforeSerialize() for further information regarding this method.
OnDrawImmediatePreview(IBrushContext, TileData, Material, Brush)
Draws preview of tile using the Unity graphics or gizmos class.
(Inherited from TilesetBrush.)
Paint(TileSystem, TileIndex)
Paint tile using brush.
(Inherited from Brush.)
Paint(TileSystem, TileIndex, Int32)
Paint tile using brush.
(Inherited from Brush.)
Paint(TileSystem, Int32, Int32)
Paint tile using brush.
(Inherited from Brush.)
Paint(TileSystem, Int32, Int32, Int32)
Paint tile using brush.
(Inherited from Brush.)
PaintWithSimpleRotation(TileSystem, TileIndex, Int32)
Paint tile with simple rotation transformation.
(Inherited from Brush.)
PaintWithSimpleRotation(TileSystem, TileIndex, Int32, Int32)
Paint tile with simple rotation transformation.
(Inherited from Brush.)
PaintWithSimpleRotation(TileSystem, Int32, Int32, Int32)
Paint tile with simple rotation transformation.
(Inherited from Brush.)
PaintWithSimpleRotation(TileSystem, Int32, Int32, Int32, Int32)
Paint tile with simple rotation transformation.
(Inherited from Brush.)
PickRandomVariationIndex(Int32)
Get random tile variation.
(Inherited from Brush.)
PostProcessTile(IBrushContext, TileData)
Post process newly painted tile.
(Inherited from TilesetBrush.)
PrepareTileData(IBrushContext, TileData, Int32)
Prepare tile data.
Refresh(TileSystem, TileIndex, RefreshFlags)
Refresh a tile.
(Inherited from Brush.)
Refresh(TileSystem, Int32, Int32, RefreshFlags)
Refresh a tile.
(Inherited from Brush.)
SetUserFlag(Int32, Boolean)
Set state of custom user flag.
(Inherited from Brush.)

Extension Methods

IsUsingCoalesceWithBrushGroups
Determines whether CoalesceWithBrushGroups is applicable for coalesable brush.

Fields

addCollider
Indicates whether box colliders should be added to painted tiles.
(Inherited from TilesetBrush.)
addInnerCollider
Indicates whether box colliders should be added to inner painted tiles.
alwaysAddContainer
Indicates whether empty container object should be created despite not being needed by brush. Container objects are named "tile" and can be seen in tile system hierarchy.
(Inherited from TilesetBrush.)
applyPrefabTransform
Indicates when prefab transform should be used to transform painted tiles.
(Inherited from Brush.)
applySimpleRotationToAttachment
Indicates whether simple tile rotation should be applied to attached objects.
(Inherited from TilesetBrush.)
attachPrefab
A prefab game object that should be added to painted tiles.
(Inherited from TilesetBrush.)
colliderType
The type of collider associated with brush.
(Inherited from TilesetBrush.)
customPreviewDesignTime
Indicates whether custom preview should be used at design time.
(Inherited from Brush.)
customPreviewImage
Allows custom preview image to be assigned to brush.
(Inherited from Brush.)
disableImmediatePreview
Indicates whether immediate preview should be disabled for this brush.
(Inherited from Brush.)
forceLegacySideways
Indicates if legacy behaviour should be assumed when painting tiles on tile systems that have sideways facing tiles.
(Inherited from Brush.)
group
Group that brush belong to.
(Inherited from Brush.)
layer
Layer to assign to game objects that are attached to painted tiles.
(Inherited from Brush.)
overrideLayer
Indicates whether brush should override the layer of game objects that are attached to painted tiles when applicable.
(Inherited from Brush.)
overrideTag
Indicates whether brush should override the tag of game objects that are attached to painted tiles when applicable.
(Inherited from Brush.)
overrideTransforms
Indicates if this brush should override the transforms of target brushes.
(Inherited from Brush.)
scaleMode
Indicates how painted tiles should be scaled.
(Inherited from Brush.)
tag
Tag to assign to game objects that are attached to painted tiles.
(Inherited from Brush.)
tileIndex
Zero-based index of tile in tileset.
(Inherited from TilesetBrush.)
transformScale
Scale to apply when transforming painted tiles.
(Inherited from Brush.)
visibility
Visibility of brush in user interfaces.
(Inherited from Brush.)

Properties

CanOverrideTagAndLayer
Gets a value indicating whether layer and tag properties can be overridden by this Brush.
(Inherited from TilesetBrush.)
CanPreserveTransform
Gets a value indicating whether transform of attached game object can be preserved when refreshing tiles.
(Inherited from Brush.)
CategoryId
Gets or sets identifier of the category that the brush belongs to.
(Inherited from Brush.)
Coalesce
Gets or sets the coalescing rule that defines how painted tiles orientate with one another.
CoalesceWithBorder
Gets or sets a value indicating whether painted tiles can coalesce with border of tile system.
CoalesceWithBrushGroups
Gets editable collection of brush groups that painted tiles can coalesce with.
CoalesceWithRotated
Gets or sets a value indicating whether painted tiles can coalesce with tiles which have been painted with a different rotation.
DesignableType
Gets user friendly name of designable type.
InnerSolidFlag
Gets or sets a value indicating whether inner painted tiles should be flagged as solid.
IsProcedural
Gets a value indicating whether brush creates procedural or non-procedural tiles.
(Inherited from TilesetBrush.)
Layout
Gets the style of autotile layout.
PerformsAutomaticOrientation
Gets a value indicating whether brush automatically orientates tiles.
Smooth
Gets or sets a value that indicates whether the normals of tiles painted using brush should be smoothed when tile system is built.
(Inherited from Brush.)
SolidFlag
Gets or sets a value indicating whether painted tiles should be flagged as solid.
(Inherited from Brush.)
Static
Gets or sets a value that indicates if brush is static.
(Inherited from Brush.)
Tileset
Gets tileset that brush belongs to.
UseWireIndicatorInEditor
Gets a value indicating whether to use wireframe cursor when painting in the editor. When false an alternative representation can be used instead.
(Inherited from TilesetBrush.)

Remarks

Basic and extended autotile layouts are supported for which some developers and artists will be familiar with. In addition to making it easier for artists to produce the artwork for their games, this also means that existing autotile artwork can be used. A template for each supported autotile layout is included which some artists may find useful when producing their artwork.

When designing the artwork for an autotile it is possible to use a variety of tile sizes provided that they are even numbers. For example, each tile could be 32x32, 48x48, etc.

Upon creating an autotile brush using the brush designer interface, an autotile atlas is automatically generated from the provided autotile artwork. The input autotile artwork is best placed within a directory named "Editor" so that it can be accessed by the editor when needed, whilst not included within final game builds.

Tiles that are painted using autotile brushes are presented using a procedurally generated mesh. If desired the procedurally generated mesh can be pre-generated when building a tile system if desired (see pregenerateProcedural).

Inheritance Hierarchy

System.Object
  Object
    ScriptableObject
      Rotorz.Tile.Brush
        Rotorz.Tile.TilesetBrush
          Rotorz.Tile.AutotileBrush

See Also

Reference