Class PrefabBrush
This Brush instances and places a containing prefab onto the targeted location and parents the instanced object to the paint target.
Inherited Members
Namespace: UnityEditor.Tilemaps
Syntax
[CustomGridBrush(false, true, false, "Prefab Brush")]
public class PrefabBrush : BasePrefabBrush
Methods
BoxErase(GridLayout, GameObject, BoundsInt)
Declaration
public override void BoxErase(GridLayout grid, GameObject brushTarget, BoundsInt bounds)
Parameters
Type | Name | Description |
---|---|---|
GridLayout | grid | |
GameObject | brushTarget | |
BoundsInt | bounds |
BoxFill(GridLayout, GameObject, BoundsInt)
Paints the PrefabBrush instance's prefab into all positions specified by the box fill tool.
Declaration
public override void BoxFill(GridLayout grid, GameObject brushTarget, BoundsInt bounds)
Parameters
Type | Name | Description |
---|---|---|
GridLayout | grid | Grid used for layout. |
GameObject | brushTarget | Target of the box fill operation. By default the currently selected GameObject. |
BoundsInt | bounds | The cooridnate boundries to fill. |
Erase(GridLayout, GameObject, Vector3Int)
If "Erase Any Objects" is true, erases any GameObjects that are in a given position within the selected layers. If "Erase Any Objects" is false, erases only GameObjects that are created from owned Prefab in a given position within the selected layers. The PrefabBrush overrides this to provide Prefab erasing functionality.
Declaration
public override void Erase(GridLayout grid, GameObject brushTarget, Vector3Int position)
Parameters
Type | Name | Description |
---|---|---|
GridLayout | grid | Grid used for layout. |
GameObject | brushTarget | Target of the erase operation. By default the currently selected GameObject. |
Vector3Int | position | The coordinates of the cell to erase data from. |
Paint(GridLayout, GameObject, Vector3Int)
Paints GameObject from containing Prefab into a given position within the selected layers. The PrefabBrush overrides this to provide Prefab painting functionality.
Declaration
public override void Paint(GridLayout grid, GameObject brushTarget, Vector3Int position)
Parameters
Type | Name | Description |
---|---|---|
GridLayout | grid | Grid used for layout. |
GameObject | brushTarget | Target of the paint operation. By default the currently selected GameObject. |
Vector3Int | position | The coordinates of the cell to paint data to. |
Pick(GridLayout, GameObject, BoundsInt, Vector3Int)
Pick prefab from selected Tilemap, given the coordinates of the cells.
Declaration
public override void Pick(GridLayout gridLayout, GameObject brushTarget, BoundsInt position, Vector3Int pickStart)
Parameters
Type | Name | Description |
---|---|---|
GridLayout | gridLayout | |
GameObject | brushTarget | |
BoundsInt | position | |
Vector3Int | pickStart |
Rotate(RotationDirection, GridLayout.CellLayout)
Rotates the brush in the given direction.
Declaration
public override void Rotate(RotationDirection direction, GridLayout.CellLayout layout)
Parameters
Type | Name | Description |
---|---|---|
RotationDirection | direction | Direction to rotate by. |
GridLayout.CellLayout | layout | Cell Layout for rotating. |