Class BaseBrushUIGroup
Provides methods for altering brush data.
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
brushMaskFilterStack
Gets the brush mask's FilterStack.
Declaration
public FilterStack brushMaskFilterStack { get; }
Property Value
Type | Description |
---|---|
FilterStack |
Implements
brushMaskFilterStackView
Gets the brush mask's FilterStackView.
Declaration
public FilterStackView brushMaskFilterStackView { get; }
Property Value
Type | Description |
---|---|
FilterStackView |
Implements
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
Remarks
Gets a value of 0 if the brush size controller isn't initialized.
brushScatter
Returns the brush scatter.
Declaration
public float brushScatter { get; }
Property Value
Type | Description |
---|---|
Single |
Remarks
Returns a value of 0 if the brush size controller isn't initialized.
brushSize
Gets and sets the brush size.
Declaration
public float brushSize { get; set; }
Property Value
Type | Description |
---|---|
Single |
Implements
Remarks
Gets a value of 100 if the brush size controller isn't initialized.
brushSpacing
Returns the brush spacing.
Declaration
public float brushSpacing { get; }
Property Value
Type | Description |
---|---|
Single |
Implements
Remarks
Returns a value of 0 if the brush size controller isn't initialized.
brushStrength
Gets and sets the brush strength.
Declaration
public float brushStrength { get; set; }
Property Value
Type | Description |
---|---|
Single |
Implements
Remarks
Gets a value of 1 if the brush size 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
hasEnabledFilters
Checks if Filters are enabled.
Declaration
public bool hasEnabledFilters { get; }
Property Value
Type | Description |
---|---|
Boolean |
Implements
InvertStrength
Inverts the brush strength.
Declaration
public bool InvertStrength { get; }
Property Value
Type | Description |
---|---|
Boolean |
Implements
isInUse
Checks if the brush is in use.
Declaration
public bool isInUse { get; }
Property Value
Type | Description |
---|---|
Boolean |
Implements
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
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 |
---|---|
UnityEngine.RaycastHit |
Implements
terrainUnderCursor
Gets and sets the terrain in focus.
Declaration
public Terrain terrainUnderCursor { get; protected set; }
Property Value
Type | Description |
---|---|
UnityEngine.Terrain |
Implements
validationMessage
Gets and sets the message for validating terrain parameters.
Declaration
public virtual string validationMessage { get; set; }
Property Value
Type | Description |
---|---|
String |
Implements
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 |
---|---|---|
UnityEngine.Terrain | terrain | The Terrain in focus. |
UnityEditor.TerrainTools.IOnSceneGUI | editContext | The IOnSceneGUI to reference. |
StringBuilder | builder | The StringBuilder containing the brush information. |
Implements
ConsumeEvents(Terrain, IOnSceneGUI)
Calls the Use function of the registered events.
Declaration
public void ConsumeEvents(Terrain terrain, IOnSceneGUI editContext)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Terrain | terrain | The terrain in focus. |
UnityEditor.TerrainTools.IOnSceneGUI | editContext | The editcontext to repaint. |
Implements
See Also
GenerateBrushMask(RenderTexture, RenderTexture)
Generates the brush mask.
Declaration
public 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. |
Implements
See Also
GenerateBrushMask(Terrain, RenderTexture, RenderTexture)
Generates the brush mask.
Declaration
public 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. |
Implements
See Also
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 |
---|---|---|
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. |
Implements
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 |
Implements
Remarks
This method is commonly used when utilizing shortcuts.
See Also
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
OnEnterToolMode()
Defines data when the brush is selected.
Declaration
public virtual void OnEnterToolMode()
Implements
See Also
OnExitToolMode()
Defines data when the brush is deselected.
Declaration
public virtual void OnExitToolMode()
Implements
See Also
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 |
---|---|---|
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. |
Implements
OnPaint(Terrain, IOnPaint)
Triggers events when painting on a terrain.
Declaration
public virtual 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. |
Implements
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 |
---|---|---|
UnityEngine.Terrain | terrain | The terrain in focus. |
UnityEditor.TerrainTools.IOnSceneGUI | editContext | The editcontext to reference. |
Implements
See Also
OnSceneGUI2D(Terrain, IOnSceneGUI)
Triggers events to render a 2D GUI within the Scene view.
Declaration
public virtual 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. |
Implements
See Also
RegisterEvent(Event)
Registers a new event to be used witin OnSceneGUI(Terrain, IOnSceneGUI).
Declaration
public void RegisterEvent(Event newEvent)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Event | newEvent | The event to add. |
Implements
RequestRepaint()
Sets the repaint request to true
.
Declaration
public void RequestRepaint()
Implements
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 |
---|---|---|
UnityEngine.Terrain | terrain | The terrain in reference. |
UnityEngine.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
UnlockTerrainUnderCursor()
Handles unlocking of the terrain cursor.
Declaration
public void UnlockTerrainUnderCursor()