docs.unity3d.com
    Show / Hide Table of Contents

    Class BaseBrushUIGroup

    Provides methods for altering brush data.

    Inheritance
    Object
    BaseBrushUIGroup
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEditor.TerrainTools
    Syntax
    public abstract class BaseBrushUIGroup : IBrushUIGroup, IBrushEventHandler, IBrushTerrainCache

    Constructors

    BaseBrushUIGroup(String, Func<TerrainToolsAnalytics.IBrushParameter[]>)

    Initializes and returns an instance of BaseBrushUIGroup.

    Declaration
    protected BaseBrushUIGroup(string name, Func<TerrainToolsAnalytics.IBrushParameter[]> analyticsCall = null)
    Parameters
    Type Name Description
    String name

    The name of the brush.

    Func<TerrainToolsAnalytics.IBrushParameter[]> analyticsCall

    The brush's analytics function.

    Fields

    isRecording

    Checks if the brush strokes are being recorded.

    Declaration
    public static bool isRecording
    Field Value
    Type Description
    Boolean

    Properties

    allowPaint

    Checks if painting is allowed.

    Declaration
    public virtual bool allowPaint { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IBrushUIGroup.allowPaint

    brushMaskFilterStack

    Gets the brush mask's FilterStack.

    Declaration
    public FilterStack brushMaskFilterStack { get; }
    Property Value
    Type Description
    FilterStack
    Implements
    IBrushUIGroup.brushMaskFilterStack

    brushMaskFilterStackView

    Gets the brush mask's FilterStackView.

    Declaration
    public FilterStackView brushMaskFilterStackView { get; }
    Property Value
    Type Description
    FilterStackView
    Implements
    IBrushUIGroup.brushMaskFilterStackView

    brushName

    Returns the brush name.

    Declaration
    public string brushName { get; }
    Property Value
    Type Description
    String

    brushRotation

    Gets and sets the brush rotation.

    Declaration
    public float brushRotation { get; set; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushRotation
    Remarks

    Gets a value of 0 if the brush rotation controller isn't initialized.

    brushRotationJitter

    Gets and sets the brush rotation jitter.

    Declaration
    public float brushRotationJitter { get; set; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushRotationJitter
    Remarks

    Gets a value of 0 if the brush rotation controller isn't initialized.

    brushRotationVal

    The strength of the brush without jitter.

    Declaration
    public float brushRotationVal { get; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushRotationVal
    Remarks

    Gets a value of 0 if the brush rotation controller isn't initialized.

    brushScatter

    Returns the brush scatter.

    Declaration
    public float brushScatter { get; set; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushScatter
    Remarks

    Returns a value of 0 if the brush scattering controller isn't initialized.

    brushSize

    Gets and sets the brush size.

    Declaration
    public float brushSize { get; set; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushSize
    Remarks

    Gets a value of 100 if the brush size controller isn't initialized.

    brushSizeJitter

    Gets and sets the brush size jitter.

    Declaration
    public float brushSizeJitter { get; set; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushSizeJitter
    Remarks

    Gets a value of 0 if the brush size controller isn't initialized.

    brushSizeMax

    Gets and sets the brush max size.

    Declaration
    public float brushSizeMax { get; set; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushSizeMax
    Remarks

    Gets a value of 1 if the brush size controller isn't initialized.

    brushSizeMin

    Gets and sets the brush min size.

    Declaration
    public float brushSizeMin { get; set; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushSizeMin
    Remarks

    Gets a value of 0 if the brush size controller isn't initialized.

    brushSizeVal

    The size of the brush without jitter.

    Declaration
    public float brushSizeVal { get; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushSizeVal
    Remarks

    Gets a value of 100 if the brush size controller isn't initialized.

    brushSpacing

    Returns the brush spacing.

    Declaration
    public float brushSpacing { get; set; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushSpacing
    Remarks

    Returns a value of 0 if the brush spacing controller isn't initialized.

    brushStrength

    Gets and sets the brush strength.

    Declaration
    public float brushStrength { get; set; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushStrength
    Remarks

    Gets a value of 1 if the brush strength controller isn't initialized.

    brushStrengthJitter

    Gets and sets the brush strength jitter.

    Declaration
    public float brushStrengthJitter { get; set; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushStrengthJitter
    Remarks

    Gets a value of 0 if the brush strength controller isn't initialized.

    brushStrengthMax

    Gets and sets the brush max strength.

    Declaration
    public float brushStrengthMax { get; set; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushStrengthMax
    Remarks

    Gets a value of 1 if the brush strength controller isn't initialized.

    brushStrengthMin

    Gets and sets the brush min strength.

    Declaration
    public float brushStrengthMin { get; set; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushStrengthMin
    Remarks

    Gets a value of 0 if the brush strength controller isn't initialized.

    brushStrengthVal

    The strength of the brush without jitter.

    Declaration
    public float brushStrengthVal { get; }
    Property Value
    Type Description
    Single
    Implements
    IBrushUIGroup.brushStrengthVal
    Remarks

    Gets a value of 1 if the brush strength controller isn't initialized.

    canUpdateTerrainUnderCursor

    Checks if the cursor is currently locked and can not be updated.

    Declaration
    public bool canUpdateTerrainUnderCursor { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IBrushTerrainCache.canUpdateTerrainUnderCursor

    hasBrushRotation

    Does the commonUI have a rotation controller?

    Declaration
    public bool hasBrushRotation { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IBrushUIGroup.hasBrushRotation

    hasBrushScatter

    Does the commonUI have a scatter controller?

    Declaration
    public bool hasBrushScatter { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IBrushUIGroup.hasBrushScatter

    hasBrushSize

    Does the commonUI have a size controller?

    Declaration
    public bool hasBrushSize { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IBrushUIGroup.hasBrushSize

    hasBrushSpacing

    Does the commonUI have a spacing controller?

    Declaration
    public bool hasBrushSpacing { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IBrushUIGroup.hasBrushSpacing

    hasBrushStrength

    Does the commonUI have a strength controller?

    Declaration
    public bool hasBrushStrength { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IBrushUIGroup.hasBrushStrength

    hasEnabledFilters

    Checks if Filters are enabled.

    Declaration
    public bool hasEnabledFilters { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IBrushUIGroup.hasEnabledFilters

    InvertStrength

    Inverts the brush strength.

    Declaration
    public bool InvertStrength { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IBrushUIGroup.InvertStrength

    isInUse

    Checks if the brush is in use.

    Declaration
    public bool isInUse { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IBrushUIGroup.isInUse

    isRaycastHitUnderCursorValid

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

    Declaration
    public bool isRaycastHitUnderCursorValid { get; }
    Property Value
    Type Description
    Boolean
    Implements
    IBrushUIGroup.isRaycastHitUnderCursorValid
    IBrushTerrainCache.isRaycastHitUnderCursorValid

    raycastHitUnderCursor

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

    Declaration
    public RaycastHit raycastHitUnderCursor { get; protected set; }
    Property Value
    Type Description
    RaycastHit
    Implements
    IBrushUIGroup.raycastHitUnderCursor
    IBrushTerrainCache.raycastHitUnderCursor

    terrainUnderCursor

    Gets and sets the terrain in focus.

    Declaration
    public Terrain terrainUnderCursor { get; protected set; }
    Property Value
    Type Description
    Terrain
    Implements
    IBrushUIGroup.terrainUnderCursor
    IBrushTerrainCache.terrainUnderCursor

    validationMessage

    Gets and sets the message for validating terrain parameters.

    Declaration
    public virtual string validationMessage { get; set; }
    Property Value
    Type Description
    String
    Implements
    IBrushUIGroup.validationMessage

    Methods

    AddController<TController>(TController)

    Adds a generic controller of type IBrushController to the brush's controller list.

    Declaration
    protected TController AddController<TController>(TController newController)
        where TController : IBrushController
    Parameters
    Type Name Description
    TController newController

    The new controller to add.

    Returns
    Type Description
    TController

    Returns the new generic controller.

    Type Parameters
    Name Description
    TController

    A generic controller type of IBrushController.

    AddModifierKeyController<TController>(TController)

    Adds a modifier key controller of type IBrushModifierKeyController to the brush's controller list.

    Declaration
    protected TController AddModifierKeyController<TController>(TController newController)
        where TController : IBrushModifierKeyController
    Parameters
    Type Name Description
    TController newController

    The new controller to add.

    Returns
    Type Description
    TController

    Returns the new modifier key controller.

    Type Parameters
    Name Description
    TController

    A generic controller type of IBrushModifierKeyController.

    AddRotationController<TController>(TController)

    Adds a rotation controller of type IBrushRotationController to the brush's controller list.

    Declaration
    protected TController AddRotationController<TController>(TController newController)
        where TController : IBrushRotationController
    Parameters
    Type Name Description
    TController newController

    The new controller to add.

    Returns
    Type Description
    TController

    Returns the new rotation controller.

    Type Parameters
    Name Description
    TController

    A generic controller type of IBrushRotationController.

    AddScatterController<TController>(TController)

    Adds a scatter controller of type IBrushScatterController to the brush's controller list.

    Declaration
    protected TController AddScatterController<TController>(TController newController)
        where TController : IBrushScatterController
    Parameters
    Type Name Description
    TController newController

    The new controller to add.

    Returns
    Type Description
    TController

    Returns the new scatter controller.

    Type Parameters
    Name Description
    TController

    A generic controller type of IBrushScatterController.

    AddSizeController<TController>(TController)

    Adds a size controller of type IBrushSizeController to the brush's controller list.

    Declaration
    protected TController AddSizeController<TController>(TController newController)
        where TController : IBrushSizeController
    Parameters
    Type Name Description
    TController newController

    The new controller to add.

    Returns
    Type Description
    TController

    Returns the new size controller.

    Type Parameters
    Name Description
    TController

    A generic controller type of IBrushSizeController.

    AddSmoothingController<TController>(TController)

    Adds a smoothing controller of type IBrushSmoothController to the brush's controller list.

    Declaration
    protected TController AddSmoothingController<TController>(TController newController)
        where TController : IBrushSmoothController
    Parameters
    Type Name Description
    TController newController

    The new controller to add.

    Returns
    Type Description
    TController

    Returns the new smoothing controller.

    Type Parameters
    Name Description
    TController

    A generic controller type of IBrushSmoothController.

    AddSpacingController<TController>(TController)

    Adds a spacing controller of type IBrushSpacingController to the brush's controller list.

    Declaration
    protected TController AddSpacingController<TController>(TController newController)
        where TController : IBrushSpacingController
    Parameters
    Type Name Description
    TController newController

    The new controller to add.

    Returns
    Type Description
    TController

    Returns the new spacing controller.

    Type Parameters
    Name Description
    TController

    A generic controller type of IBrushSpacingController.

    AddStrengthController<TController>(TController)

    Adds a strength controller of type IBrushStrengthController to the brush's controller list.

    Declaration
    protected TController AddStrengthController<TController>(TController newController)
        where TController : IBrushStrengthController
    Parameters
    Type Name Description
    TController newController

    The new controller to add.

    Returns
    Type Description
    TController

    Returns the new strength controller.

    Type Parameters
    Name Description
    TController

    A generic controller type of IBrushStrengthController.

    AppendBrushInfo(Terrain, IOnSceneGUI, StringBuilder)

    Adds basic information to the selected brush.

    Declaration
    public virtual 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.

    Implements
    IBrushUIGroup.AppendBrushInfo(Terrain, IOnSceneGUI, StringBuilder)

    ConsumeEvents(Terrain, IOnSceneGUI)

    Calls the Use function of the registered events.

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

    The terrain in focus.

    IOnSceneGUI editContext

    The editcontext to repaint.

    Implements
    IBrushEventHandler.ConsumeEvents(Terrain, IOnSceneGUI)
    See Also
    RegisterEvent(Event)

    GenerateBrushMask(IBrushRenderUnderCursor, RenderTexture)

    Generates the brush mask.

    Declaration
    public 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.

    Implements
    IBrushUIGroup.GenerateBrushMask(IBrushRenderUnderCursor, RenderTexture)

    GenerateBrushMask(RenderTexture, RenderTexture)

    Generates the brush mask.

    Declaration
    public 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.

    Implements
    IBrushUIGroup.GenerateBrushMask(RenderTexture, RenderTexture)
    See Also
    GenerateBrushMask(Terrain, RenderTexture, RenderTexture, Vector3, Single, Single)

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

    Generates the brush mask.

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

    The terrain in focus.

    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.

    Vector3 position

    The brush's position.

    Single scale

    The brush's scale.

    Single rotation

    The brush's rotation.

    Remarks

    Note: Using this version of the overloaded method allows for the use of the Layer Filter

    GenerateBrushMask(Terrain, RenderTexture, RenderTexture)

    Generates the brush mask.

    Declaration
    public 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.

    Implements
    IBrushUIGroup.GenerateBrushMask(Terrain, RenderTexture, RenderTexture)
    See Also
    GenerateBrushMask(Terrain, RenderTexture, RenderTexture, Vector3, Single, Single)

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

    Generates the brush mask.

    Declaration
    public 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.

    Implements
    IBrushUIGroup.GenerateBrushMask(Terrain, RenderTexture, RenderTexture, Vector3, Single, Single)
    Remarks

    Note: Use if Layer Filtering capabilities are desired.

    getBrushInfoText()

    Declaration
    public static string getBrushInfoText()
    Returns
    Type Description
    String

    LockTerrainUnderCursor(Boolean)

    Handles the locking of the terrain cursor in it's current position.

    Declaration
    public void LockTerrainUnderCursor(bool cursorVisible)
    Parameters
    Type Name Description
    Boolean cursorVisible

    Whether the cursor is visible within the scene. When the value is true the cursor is visible.

    Implements
    IBrushTerrainCache.LockTerrainUnderCursor(Boolean)
    Remarks

    This method is commonly used when utilizing shortcuts.

    See Also
    UnlockTerrainUnderCursor()

    ModifierActive(BrushModifierKey)

    Activates a modifier key controller.

    Declaration
    public 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.

    Implements
    IBrushUIGroup.ModifierActive(BrushModifierKey)

    OnEnterToolMode()

    Defines data when the brush is selected.

    Declaration
    public virtual void OnEnterToolMode()
    Implements
    IBrushUIGroup.OnEnterToolMode()
    See Also
    OnExitToolMode()

    OnExitToolMode()

    Defines data when the brush is deselected.

    Declaration
    public virtual void OnExitToolMode()
    Implements
    IBrushUIGroup.OnExitToolMode()
    See Also
    OnEnterToolMode()

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

    Renders the brush's GUI within the inspector view.

    Declaration
    public virtual 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
    Implements
    IBrushUIGroup.OnInspectorGUI(Terrain, IOnInspectorGUI, Boolean, BrushGUIEditFlags, BrushOverlaysGUIFlags)

    OnInspectorGUI(Terrain, IOnInspectorGUI, BrushGUIEditFlags)

    Renders the brush's GUI within the inspector view.

    Declaration
    public virtual 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.

    Implements
    IBrushUIGroup.OnInspectorGUI(Terrain, IOnInspectorGUI, BrushGUIEditFlags)

    OnPaint(Terrain, IOnPaint)

    Triggers events when painting on a terrain.

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

    The terrain in focus.

    IOnPaint editContext

    The editcontext to reference.

    Implements
    IBrushUIGroup.OnPaint(Terrain, IOnPaint)

    OnSceneGUI(Terrain, IOnSceneGUI)

    Triggers events to render objects and displays within Scene view.

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

    The terrain in focus.

    IOnSceneGUI editContext

    The editcontext to reference.

    Implements
    IBrushUIGroup.OnSceneGUI(Terrain, IOnSceneGUI)
    See Also
    OnSceneGUI(Terrain, IOnSceneGUI)

    OnSceneGUI2D(Terrain, IOnSceneGUI)

    Declaration
    public virtual void OnSceneGUI2D(Terrain terrain, IOnSceneGUI editContext)
    Parameters
    Type Name Description
    Terrain terrain
    IOnSceneGUI editContext
    Implements
    IBrushUIGroup.OnSceneGUI2D(Terrain, IOnSceneGUI)

    RegisterEvent(Event)

    Registers a new event to be used witin OnSceneGUI(Terrain, IOnSceneGUI).

    Declaration
    public void RegisterEvent(Event newEvent)
    Parameters
    Type Name Description
    Event newEvent

    The event to add.

    Implements
    IBrushEventHandler.RegisterEvent(Event)

    RequestRepaint()

    Sets the repaint request to true.

    Declaration
    public void RequestRepaint()
    Implements
    IBrushEventHandler.RequestRepaint()

    ScatterBrushStamp(ref Terrain, ref Vector2)

    Scatters the location of the brush's stamp operation.

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

    The terrain in reference.

    Vector2 uv

    The UV location to scatter at.

    Returns
    Type Description
    Boolean

    Returns false if there aren't any terrains to scatter the stamp on.

    Implements
    IBrushUIGroup.ScatterBrushStamp(ref Terrain, ref Vector2)

    UnlockTerrainUnderCursor()

    Handles unlocking of the terrain cursor.

    Declaration
    public void UnlockTerrainUnderCursor()
    Implements
    IBrushTerrainCache.UnlockTerrainUnderCursor()
    See Also
    LockTerrainUnderCursor(Boolean)

    Events

    brushInfoAccessed

    Declaration
    public static event Action brushInfoAccessed
    Event Type
    Type Description
    Action
    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