Default built-in brush for painting or erasing tiles and/or gamobjects on a grid.
Default brush is meant for two things: Authoring GameObjects on a grid and authoring tiles on a grid. It can be used for both at the same time if necessary. Basically the default brush allows you to pick and paste tiles and GameObjects from one area to another.
Tiles in a tilemap are considered to be active for brush editing if a GameObject with Tilemap is currently selected.
GameObjects are considered to be active for brush editing if their parent GameObject is currently selected.
For example: A new default brush with size of 2x3 is generated as a result of Scene view picking operation. The new instance contains six cells (BrushCell) and the cells are fed with tiles & GameObjects from the picking area.
Later when this brush is used in a painting operation, all the tiles and GameObjects contained in the cells are set/cloned into a new Scene position.
When creating custom brushes, it is recommended to inherit GridBrushBase by default. Inheriting GridBrush is possible when similar functionality is required, but extending it has its limits compared to base class.
It is also possible to replace the default GridBrush from the Tile Palette brush list completely by using the GridDefaultBrush attribute on one of your custom brushes and promote it to become a new default brush of the project. This is useful when higher level brush can operate as a default and protect designers from accidentally using the built-in one.
cellCount | Number of brush cells in the brush. |
cells | All the brush cells the brush holds. |
pivot | Pivot of the brush. |
size | Size of the brush in cells. |
BoxErase | Erases tiles and GameObjects from given bounds within the selected layers. |
BoxFill | Box fills tiles and GameObjects into given bounds within the selected layers. |
Erase | Erases tiles and GameObjects in a given position within the selected layers. |
Flip | Flips the brush in the given axis. |
FloodFill | Flood fills tiles and GameObjects starting from a given position within the selected layers. |
GetCellIndex | Gets the index to the GridBrush.BrushCell based on the position of the BrushCell. |
GetCellIndexWrapAround | Gets the index to the GridBrush.BrushCell based on the position of the BrushCell. Wraps each coordinate if it is larger than the size of the GridBrush. |
Init | Initializes the content of the GridBrush. |
MoveEnd | MoveEnd is called when user has ended the move of the area previously selected with the selection marquee. |
MoveStart | MoveEnd is called when user starts moving the area previously selected with the selection marquee. |
Paint | Paints tiles and GameObjects into a given position within the selected layers. |
Pick | Picks tiles from selected tile maps and child GameObjects, given the coordinates of the cells. |
Reset | Clear all data of the brush. |
Rotate | Rotates the brush by 90 degrees in the given direction. |
SetColor | Sets a tint color at the position in the brush. |
SetMatrix | Sets a transform matrix at the position in the brush. This matrix is used specifically for tiles on a Tilemap and not GameObjects of the brush cell. |
SetTile | Sets a Tile at the position in the brush. |
UpdateSizeAndPivot | Updates the size, pivot and the number of layers of the brush. |
hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
name | オブジェクト名 |
ChangeZPosition | Changes the Z position of the GridBrushBase. |
Move | Move is called when user moves the area previously selected with the selection marquee. |
ResetZPosition | Resets Z position changes of the GridBrushBase. |
Select | Select an area of a grid. |
GetInstanceID | オブジェクトのインスタンス ID を返します |
ToString | Returns the name of the GameObject. |
Destroy | ゲームオブジェクトやコンポーネント、アセットを削除します |
DestroyImmediate | Destroys the object obj immediately. You are strongly recommended to use Destroy instead. |
DontDestroyOnLoad | Do not destroy the target Object when loading a new Scene. |
FindObjectOfType | タイプ type から最初に見つけたアクティブのオブジェクトを返します |
FindObjectsOfType | タイプから見つけたすべてのアクティブのオブジェクト配列を返します |
Instantiate | original のオブジェクトをクローンします |
CreateInstance | ScriptableObject のインスタンスを作成します。 |
bool | オブジェクトが存在するかどうか |
operator != | 二つのオブジェクトが異なるオブジェクトを参照しているか比較します |
operator == | 2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.