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; }
Property Value
Type | Description |
---|---|
Single |
brushSize
The normalized size of the brush.
Declaration
float brushSize { get; }
Property Value
Type | Description |
---|---|
Single |
brushSpacing
The spacing used when applying certain brushes.
Declaration
float brushSpacing { get; }
Property Value
Type | Description |
---|---|
Single |
brushStrength
The normalized strength of the brush when applied.
Declaration
float brushStrength { get; }
Property Value
Type | Description |
---|---|
Single |
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 |
---|---|
UnityEngine.RaycastHit |
terrainUnderCursor
Gets a reference to the terrain under the cursor.
Declaration
Terrain terrainUnderCursor { get; }
Property Value
Type | Description |
---|---|
UnityEngine.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 |
---|---|---|
UnityEngine.Terrain | terrain | The Terrain in focus. |
UnityEditor.TerrainTools.IOnSceneGUI | editContext | The IOnSceneGUI to reference. |
StringBuilder | builder | The StringBuilder containing the brush information. |
GenerateBrushMask(RenderTexture, RenderTexture)
Generates the brush mask.
Declaration
void GenerateBrushMask(RenderTexture sourceRenderTexture, RenderTexture destinationRenderTexture)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.RenderTexture | sourceRenderTexture | The source render texture to blit from. |
UnityEngine.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 |
---|---|---|
UnityEngine.Terrain | terrain | The terrain in focus. |
UnityEngine.RenderTexture | sourceRenderTexture | The source render texture to blit from. |
UnityEngine.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)
Generates the brush mask.
Declaration
void GenerateBrushMask(Terrain terrain, RenderTexture sourceRenderTexture, RenderTexture destinationRenderTexture, Vector3 position, float scale, float rotation)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Terrain | terrain | The terrain in focus. |
UnityEngine.RenderTexture | sourceRenderTexture | The source render texture to blit from. |
UnityEngine.RenderTexture | destinationRenderTexture | The destination render texture for bliting to. |
UnityEngine.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()
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 |
---|---|---|
UnityEngine.Terrain | terrain | The terrain in focus. |
UnityEditor.TerrainTools.IOnInspectorGUI | editContext | The editcontext used to show the brush GUI. |
UnityEditor.TerrainTools.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 |
---|---|---|
UnityEngine.Terrain | terrain | The terrain in focus. |
UnityEditor.TerrainTools.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 |
---|---|---|
UnityEngine.Terrain | terrain | The terrain in focus. |
UnityEditor.TerrainTools.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 |
---|---|---|
UnityEngine.Terrain | terrain | The terrain in focus. |
UnityEditor.TerrainTools.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 |
---|---|---|
UnityEngine.Terrain | terrain | The terrain the scattered UV co-ordinate is actually on. |
UnityEngine.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. |