docs.unity3d.com
    Show / Hide Table of Contents

    Line Brush Line Brush Icon

    Contribution by : CraigGraff

    This Brush draws a line of Tiles onto a Tilemap. With this Brush selected, click once to set the starting point of the line and click again at another position to set the ending point of the line. This Brush then draws a line of Tiles between the two points.

    Use this as an example to create custom Brush behavior to make painting more efficient.

    Properties

    Property Function
    Line Start Active Indicates whether the Line Brush has started drawing a line.
    Fill Gaps Ensures that there are orthogonal connections between all Tiles that connect the start and end of the line.
    Line Start The current starting point of the line.

    Usage

    Select the Line Brush, then click once on a cell of the Tilemap to set the starting point of the line, then click on a second cell to set the ending point of the line. The Brush then draws the line of Tiles between the two set points. When the Line Brush is active, a blue outline will indicate the starting point of the line.

    Scene View with Line Brush

    To have Tiles which are orthogonally connected from start to end, enable the Fill Gaps property in the Brush Editor.

    Scene View with Line Brush with Fill Gaps

    Implementation

    The Line Brush inherits from the Grid Brush and overrides the Paint method to implement the line painting functionality.

    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