Interface IBrushUIGroup
An interface that represent the brush's common UI.
Namespace: UnityEditor.TerrainTools
Assembly: Unity.TerrainTools.Editor.dll
Syntax
public interface IBrushUIGroup
Properties
InvertStrength
Inverts the brush's strength.
Declaration
bool InvertStrength { get; }
Property Value
| Type | Description |
|---|---|
| bool |
allowPaint
Are we allowed to paint with this brush?
Declaration
bool allowPaint { get; }
Property Value
| Type | Description |
|---|---|
| bool |
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; }
Property Value
| Type | Description |
|---|---|
| float |
brushSize
The normalized size of the brush.
Declaration
float brushSize { get; }
Property Value
| Type | Description |
|---|---|
| float |
brushSpacing
The spacing used when applying certain brushes.
Declaration
float brushSpacing { get; }
Property Value
| Type | Description |
|---|---|
| float |
brushStrength
The normalized strength of the brush when applied.
Declaration
float brushStrength { get; }
Property Value
| Type | Description |
|---|---|
| float |
hasEnabledFilters
Checks if the brush has enabled filters.
Declaration
bool hasEnabledFilters { get; }
Property Value
| Type | Description |
|---|---|
| bool |
isInUse
Checks if the brush is in use.
Declaration
bool isInUse { get; }
Property Value
| Type | Description |
|---|---|
| bool |
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 |
|---|---|
| bool |
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)
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, float, float)
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. |
| float | scale | The brush's scale. |
| float | 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 |
|---|---|
| bool | Returns false when the modifier key controller is null. |
OnEnterToolMode()
Defines data when the brush is selected.
Declaration
void OnEnterToolMode()
See Also
OnExitToolMode()
Defines data when the brush is deselected.
Declaration
void OnExitToolMode()
See Also
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
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
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 |
|---|---|
| bool | "true" if we scattered to a terrain, "false" if we fell off ALL terrains. |