docs.unity3d.com
    Show / Hide Table of Contents

    Class PrefabBrush

    This Brush instances and places a containing prefab onto the targeted location and parents the instanced object to the paint target.

    Inheritance
    Object
    GridBrush
    BasePrefabBrush
    PrefabBrush
    Inherited Members
    BasePrefabBrush.m_Anchor
    BasePrefabBrush.GetObjectsInCell(GridLayout, Transform, Vector3Int)
    BasePrefabBrush.InstantiatePrefabInCell(GridLayout, GameObject, Vector3Int, GameObject, Quaternion)
    UnityEditor.Tilemaps.GridBrush.Init(UnityEngine.Vector3Int)
    UnityEditor.Tilemaps.GridBrush.Init(UnityEngine.Vector3Int, UnityEngine.Vector3Int)
    UnityEditor.Tilemaps.GridBrush.FloodFill(UnityEngine.GridLayout, UnityEngine.GameObject, UnityEngine.Vector3Int)
    UnityEditor.Tilemaps.GridBrush.Rotate(UnityEngine.GridBrushBase.RotationDirection, UnityEngine.GridLayout.CellLayout)
    UnityEditor.Tilemaps.GridBrush.Flip(UnityEngine.GridBrushBase.FlipAxis, UnityEngine.GridLayout.CellLayout)
    UnityEditor.Tilemaps.GridBrush.MoveStart(UnityEngine.GridLayout, UnityEngine.GameObject, UnityEngine.BoundsInt)
    UnityEditor.Tilemaps.GridBrush.MoveEnd(UnityEngine.GridLayout, UnityEngine.GameObject, UnityEngine.BoundsInt)
    GridBrush.Reset()
    UnityEditor.Tilemaps.GridBrush.UpdateSizeAndPivot(UnityEngine.Vector3Int, UnityEngine.Vector3Int)
    UnityEditor.Tilemaps.GridBrush.SetTile(UnityEngine.Vector3Int, UnityEngine.Tilemaps.TileBase)
    UnityEditor.Tilemaps.GridBrush.SetMatrix(UnityEngine.Vector3Int, UnityEngine.Matrix4x4)
    UnityEditor.Tilemaps.GridBrush.SetColor(UnityEngine.Vector3Int, UnityEngine.Color)
    UnityEditor.Tilemaps.GridBrush.GetCellIndex(UnityEngine.Vector3Int)
    GridBrush.GetCellIndex(Int32, Int32, Int32)
    GridBrush.GetCellIndex(Int32, Int32, Int32, Int32, Int32, Int32)
    GridBrush.GetCellIndexWrapAround(Int32, Int32, Int32)
    GridBrush.GetHashCode()
    GridBrush.size
    GridBrush.pivot
    GridBrush.cells
    GridBrush.cellCount
    UnityEditor.Tilemaps.GridBrush.canChangeZPosition
    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.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023