docs.unity3d.com
    Show / Hide Table of Contents

    Interface IBrushUIGroup

    An interface that represent the brush's common UI.

    Namespace: UnityEditor.TerrainTools
    Syntax
    public interface IBrushUIGroup

    Properties

    allowPaint

    Are we allowed to paint with this brush?

    Declaration
    bool allowPaint { get; }
    Property Value
    Type Description
    Boolean

    brushMaskFilterStack

    Gets the brush mask's Filter stack.

    Declaration
    FilterStack brushMaskFilterStack { get; }
    Property Value
    Type Description
    FilterStack

    brushMaskFilterStackView

    Gets the brush mask's Filter stack view.

    Declaration
    FilterStackView brushMaskFilterStackView { get; }
    Property Value
    Type Description
    FilterStackView

    brushRotation

    The rotation of the brush (in degrees).

    Declaration
    float brushRotation { get; set; }
    Property Value
    Type Description
    Single

    brushRotationJitter

    The jitter of the brush rotation when applied.

    Declaration
    float brushRotationJitter { get; set; }
    Property Value
    Type Description
    Single

    brushRotationVal

    The rotation of the brush without jitter (in degrees).

    Declaration
    float brushRotationVal { get; }
    Property Value
    Type Description
    Single

    brushScatter

    The scatter used when applying certain brushes.

    Declaration
    float brushScatter { get; set; }
    Property Value
    Type Description
    Single

    brushSize

    The normalized size of the brush.

    Declaration
    float brushSize { get; set; }
    Property Value
    Type Description
    Single

    brushSizeJitter

    The jitter of the brush size when applied.

    Declaration
    float brushSizeJitter { get; set; }
    Property Value
    Type Description
    Single

    brushSizeMax

    The max size of the brush when applied.

    Declaration
    float brushSizeMax { get; set; }
    Property Value
    Type Description
    Single

    brushSizeMin

    The min size of the brush when applied.

    Declaration
    float brushSizeMin { get; set; }
    Property Value
    Type Description
    Single

    brushSizeVal

    The size of the brush without jitter.

    Declaration
    float brushSizeVal { get; }
    Property Value
    Type Description
    Single

    brushSpacing

    The spacing used when applying certain brushes.

    Declaration
    float brushSpacing { get; set; }
    Property Value
    Type Description
    Single

    brushStrength

    The normalized strength of the brush when applied.

    Declaration
    float brushStrength { get; set; }
    Property Value
    Type Description
    Single

    brushStrengthJitter

    The jitter of the brush strength when applied.

    Declaration
    float brushStrengthJitter { get; set; }
    Property Value
    Type Description
    Single

    brushStrengthMax

    The max strength of the brush when applied.

    Declaration
    float brushStrengthMax { get; set; }
    Property Value
    Type Description
    Single

    brushStrengthMin

    The min strength of the brush when applied.

    Declaration
    float brushStrengthMin { get; set; }
    Property Value
    Type Description
    Single

    brushStrengthVal

    The strength of the brush without jitter.

    Declaration
    float brushStrengthVal { get; }
    Property Value
    Type Description
    Single

    hasBrushRotation

    Does the commonUI have a rotation controller?

    Declaration
    bool hasBrushRotation { get; }
    Property Value
    Type Description
    Boolean

    hasBrushScatter

    Does the commonUI have a scatter controller?

    Declaration
    bool hasBrushScatter { get; }
    Property Value
    Type Description
    Boolean

    hasBrushSize

    Does the commonUI have a size controller?

    Declaration
    bool hasBrushSize { get; }
    Property Value
    Type Description
    Boolean

    hasBrushSpacing

    Does the commonUI have a spacing controller?

    Declaration
    bool hasBrushSpacing { get; }
    Property Value
    Type Description
    Boolean

    hasBrushStrength

    Does the commonUI have a strength controller?

    Declaration
    bool hasBrushStrength { get; }
    Property Value
    Type Description
    Boolean

    hasEnabledFilters

    Checks if the brush has enabled filters.

    Declaration
    bool hasEnabledFilters { get; }
    Property Value
    Type Description
    Boolean

    InvertStrength

    Inverts the brush's strength.

    Declaration
    bool InvertStrength { get; }
    Property Value
    Type Description
    Boolean

    isInUse

    Checks if the brush is in use.

    Declaration
    bool isInUse { get; }
    Property Value
    Type Description
    Boolean

    isRaycastHitUnderCursorValid

    Gets and sets the value associated to whether there is a raycast hit detecting a terrain under the cursor.

    Declaration
    bool isRaycastHitUnderCursorValid { get; }
    Property Value
    Type Description
    Boolean

    raycastHitUnderCursor

    Gets and sets the raycast hit that was under the cursor's position.

    Declaration
    RaycastHit raycastHitUnderCursor { get; }
    Property Value
    Type Description
    RaycastHit

    terrainUnderCursor

    Gets a reference to the terrain under the cursor.

    Declaration
    Terrain terrainUnderCursor { get; }
    Property Value
    Type Description
    Terrain

    validationMessage

    Gets and sets the message for validating terrain parameters.

    Declaration
    string validationMessage { get; set; }
    Property Value
    Type Description
    String

    Methods

    AppendBrushInfo(Terrain, IOnSceneGUI, StringBuilder)

    Adds basic information to the selected brush.

    Declaration
    void AppendBrushInfo(Terrain terrain, IOnSceneGUI editContext, StringBuilder builder)
    Parameters
    Type Name Description
    Terrain terrain

    The Terrain in focus.

    IOnSceneGUI editContext

    The IOnSceneGUI to reference.

    StringBuilder builder

    The StringBuilder containing the brush information.

    GenerateBrushMask(IBrushRenderUnderCursor, RenderTexture)

    Generates the brush mask.

    Declaration
    void GenerateBrushMask(IBrushRenderUnderCursor brushRender, RenderTexture destinationRenderTexture)
    Parameters
    Type Name Description
    IBrushRenderUnderCursor brushRender

    The brushRender object used for acquiring the heightmap and splatmap texture to blit from.

    RenderTexture destinationRenderTexture

    The destination render texture for bliting to.

    Remarks

    This overload method enables the use of the Layer Filter.

    GenerateBrushMask(RenderTexture, RenderTexture)

    Generates the brush mask.

    Declaration
    void GenerateBrushMask(RenderTexture sourceRenderTexture, RenderTexture destinationRenderTexture)
    Parameters
    Type Name Description
    RenderTexture sourceRenderTexture

    The source render texture to blit from.

    RenderTexture destinationRenderTexture

    The destination render texture for bliting to.

    Remarks

    Use this overload method to let Unity handle passing the brush's parameters and terrain reference to the main GenerateBrushMask meethod.

    See Also
    GenerateBrushMask(Terrain, RenderTexture, RenderTexture, Vector3, Single, Single)

    GenerateBrushMask(Terrain, RenderTexture, RenderTexture)

    Generates the brush mask.

    Declaration
    void GenerateBrushMask(Terrain terrain, RenderTexture sourceRenderTexture, RenderTexture destinationRenderTexture)
    Parameters
    Type Name Description
    Terrain terrain

    The terrain in focus.

    RenderTexture sourceRenderTexture

    The source render texture to blit from.

    RenderTexture destinationRenderTexture

    The destination render texture for bliting to.

    Remarks

    Use this overload method to let Unity handle passing the brush's parameters to the main GenerateBrushMask meethod.

    See Also
    GenerateBrushMask(Terrain, RenderTexture, RenderTexture, Vector3, Single, Single)

    GenerateBrushMask(Terrain, RenderTexture, RenderTexture, Vector3, Single, Single)

    Generates the brush mask.

    Declaration
    void GenerateBrushMask(Terrain terrain, RenderTexture sourceRenderTexture, RenderTexture destinationRenderTexture, Vector3 position, float scale, float rotation)
    Parameters
    Type Name Description
    Terrain terrain

    The terrain in focus.

    RenderTexture sourceRenderTexture

    The source render texture to blit from.

    RenderTexture destinationRenderTexture

    The destination render texture for bliting to.

    Vector3 position

    The brush's position.

    Single scale

    The brush's scale.

    Single rotation

    The brush's rotation.

    Remarks

    This is the main overload method for generating brush mask.

    ModifierActive(BrushModifierKey)

    Activates a modifier key controller.

    Declaration
    bool ModifierActive(BrushModifierKey k)
    Parameters
    Type Name Description
    BrushModifierKey k

    The modifier key to activate.

    Returns
    Type Description
    Boolean

    Returns false when the modifier key controller is null.

    OnEnterToolMode()

    Defines data when the brush is selected.

    Declaration
    void OnEnterToolMode()
    See Also
    OnExitToolMode()

    OnExitToolMode()

    Defines data when the brush is deselected.

    Declaration
    void OnExitToolMode()
    See Also
    OnEnterToolMode()

    OnInspectorGUI(Terrain, IOnInspectorGUI, Boolean, BrushGUIEditFlags, BrushOverlaysGUIFlags)

    Renders the brush's GUI within the inspector view.

    Declaration
    void OnInspectorGUI(Terrain terrain, IOnInspectorGUI editContext, bool overlays, BrushGUIEditFlags brushFlags = BrushGUIEditFlags.SelectAndInspect, BrushOverlaysGUIFlags brushOverlaysFlags = BrushOverlaysGUIFlags.All)
    Parameters
    Type Name Description
    Terrain terrain

    The terrain in focus.

    IOnInspectorGUI editContext

    The editcontext used to show the brush GUI.

    Boolean overlays

    The bool to mark true when showing UI specific for overlays.

    BrushGUIEditFlags brushFlags

    The brushflags to use when displaying the brush GUI.

    BrushOverlaysGUIFlags brushOverlaysFlags

    the overlays brushflags to use when displaying the GUI

    OnInspectorGUI(Terrain, IOnInspectorGUI, BrushGUIEditFlags)

    Renders the brush's GUI within the inspector view.

    Declaration
    void OnInspectorGUI(Terrain terrain, IOnInspectorGUI editContext, BrushGUIEditFlags brushFlags = BrushGUIEditFlags.SelectAndInspect)
    Parameters
    Type Name Description
    Terrain terrain

    The terrain in focus.

    IOnInspectorGUI editContext

    The editcontext used to show the brush GUI.

    BrushGUIEditFlags brushFlags

    The brushflags to use when displaying the brush GUI.

    OnPaint(Terrain, IOnPaint)

    Triggers events when painting on a terrain.

    Declaration
    void OnPaint(Terrain terrain, IOnPaint editContext)
    Parameters
    Type Name Description
    Terrain terrain

    The terrain in focus.

    IOnPaint editContext

    The editcontext to reference.

    OnSceneGUI(Terrain, IOnSceneGUI)

    Triggers events to render objects and displays within Scene view.

    Declaration
    void OnSceneGUI(Terrain terrain, IOnSceneGUI editContext)
    Parameters
    Type Name Description
    Terrain terrain

    The terrain in focus.

    IOnSceneGUI editContext

    The editcontext to reference.

    See Also
    OnSceneGUI(Terrain, IOnSceneGUI)

    OnSceneGUI2D(Terrain, IOnSceneGUI)

    Triggers events to render a 2D GUI within the Scene view.

    Declaration
    void OnSceneGUI2D(Terrain terrain, IOnSceneGUI editContext)
    Parameters
    Type Name Description
    Terrain terrain

    The terrain in focus.

    IOnSceneGUI editContext

    The editcontext to reference.

    See Also
    OnSceneGUI(Terrain, IOnSceneGUI)

    ScatterBrushStamp(ref Terrain, ref Vector2)

    Scatters the brush around the specified UV on the specified terrain. If the scattered UV leaves the current terrain then the terrain AND UV are modified for the terrain the UV is now over.

    Declaration
    bool ScatterBrushStamp(ref Terrain terrain, ref Vector2 uv)
    Parameters
    Type Name Description
    Terrain terrain

    The terrain the scattered UV co-ordinate is actually on.

    Vector2 uv

    The UV co-ordinate passed in transformed into the UV co-ordinate relative to the scattered terrain.

    Returns
    Type Description
    Boolean

    "true" if we scattered to a terrain, "false" if we fell off ALL terrains.

    Back to top
    Copyright © 2023 Unity Technologies
    • 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 Friday, November 3, 2023