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

Brush Class

A brush is a template that defines how tiles can be painted and maintained on a tile system. Brushes are typically used in conjunction with tools when using the editor, however it is useful to note that brushes can also be orchestrated by custom scripts at runtime.
public abstract class Brush : ScriptableObject, 
	IDesignableObject, IHistoryObject, ISerializationCallbackReceiver
public abstract class Brush extends ScriptableObject
	implements IDesignableObject, IHistoryObject, ISerializationCallbackReceiver

For information regarding creation and usage of brushes please refer to Brushes section of user guide.

Methods

ApplyTransforms(IBrushContext, TileData, Brush)
Apply transforms to newly painted tile and orientate against tile system.
Awake()
Invoked when brush first becomes active.
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.
CountTileVariations(Int32)
Count the number of tile variations.
CreateTile(IBrushContext, TileData)
Create visual representation of tile.
Cycle(TileSystem, TileIndex, Int32)
Cycle through tile variations.
Cycle(TileSystem, Int32, Int32, Int32)
Cycle through tile variations.
CycleWithSimpleRotation(TileSystem, TileIndex, Int32, Int32)
Cycle through tile variations and/or rotation indices.
CycleWithSimpleRotation(TileSystem, Int32, Int32, Int32, Int32)
Cycle through tile variations and/or rotation indices.
DestroyTileGameObject(TileData, TileSystem)
Destroy game object that is associated with tile using the current object factory. Uses the runtime object factory in play mode or the editor object factory in edit mode.
GetNthMaterial(Int32)
Gets the nth material from available renderers.
GetTransformMatrix(TileSystem, TileIndex, Int32, Transform)
Gets matrix that describes transformation of tile painted using brush in local space of tile system.
GetTransformMatrix(TileSystem, Int32, Int32, Int32, Transform)
Gets matrix that describes transformation of tile painted using brush in local space of tile system.
GetUserFlag(Int32)
Get state of custom user flag.
InstantiatePrefabForTile(GameObject, TileData, TileSystem)
Instantate prefab for tile using the current object factory. Uses the runtime object factory in play mode or the editor object factory in edit mode.
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.
Paint(TileSystem, TileIndex)
Paint tile using brush.
Paint(TileSystem, TileIndex, Int32)
Paint tile using brush.
Paint(TileSystem, Int32, Int32)
Paint tile using brush.
Paint(TileSystem, Int32, Int32, Int32)
Paint tile using brush.
PaintWithSimpleRotation(TileSystem, TileIndex, Int32)
Paint tile with simple rotation transformation.
PaintWithSimpleRotation(TileSystem, TileIndex, Int32, Int32)
Paint tile with simple rotation transformation.
PaintWithSimpleRotation(TileSystem, Int32, Int32, Int32)
Paint tile with simple rotation transformation.
PaintWithSimpleRotation(TileSystem, Int32, Int32, Int32, Int32)
Paint tile with simple rotation transformation.
PickRandomVariationIndex(Int32)
Get random tile variation.
PostProcessTile(IBrushContext, TileData)
Post process newly painted tile.
PrepareTileData(IBrushContext, TileData, Int32)
Prepare tile data.
Refresh(TileSystem, TileIndex, RefreshFlags)
Refresh a tile.
Refresh(TileSystem, Int32, Int32, RefreshFlags)
Refresh a tile.
SetUserFlag(Int32, Boolean)
Set state of custom user flag.

Fields

applyPrefabTransform
Indicates when prefab transform should be used to transform painted tiles.
customPreviewDesignTime
Indicates whether custom preview should be used at design time.
customPreviewImage
Allows custom preview image to be assigned to brush.
disableImmediatePreview
Indicates whether immediate preview should be disabled for this brush.
forceLegacySideways
Indicates if legacy behaviour should be assumed when painting tiles on tile systems that have sideways facing tiles.
group
Group that brush belong to.
layer
Layer to assign to game objects that are attached to painted tiles.
overrideLayer
Indicates whether brush should override the layer of game objects that are attached to painted tiles when applicable.
overrideTag
Indicates whether brush should override the tag of game objects that are attached to painted tiles when applicable.
overrideTransforms
Indicates if this brush should override the transforms of target brushes.
RANDOM_VARIATION
Indicates that a random variation should be used.
scaleMode
Indicates how painted tiles should be scaled.
tag
Tag to assign to game objects that are attached to painted tiles.
transformScale
Scale to apply when transforming painted tiles.
visibility
Visibility of brush in user interfaces.

Properties

CanOverrideTagAndLayer
Gets a value indicating whether layer and tag properties can be overridden by this Brush.
CanPreserveTransform
Gets a value indicating whether transform of attached game object can be preserved when refreshing tiles.
CategoryId
Gets or sets identifier of the category that the brush belongs to.
DesignableType
Gets user friendly name of designable type.
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.
SolidFlag
Gets or sets a value indicating whether painted tiles should be flagged as solid.
Static
Gets or sets a value that indicates if brush is static.
UseWireIndicatorInEditor
Gets a value indicating whether to use wireframe cursor when painting in the editor. When false an alternative representation can be used instead.

Inheritance Hierarchy

System.Object
  Object
    ScriptableObject
      Rotorz.Tile.Brush
        Rotorz.Tile.AliasBrush
        Rotorz.Tile.EmptyBrush
        Rotorz.Tile.OrientedBrush
        Rotorz.Tile.TilesetBrush

See Also

Reference