Version: 2023.1
LanguageEnglish
  • C#

TerrainPaintToolWithOverlaysBase

class in UnityEditor.TerrainTools

/

Inherits from:EditorTools.EditorTool

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

The abstract class that TerrainPaintToolWithOverlays inherits from.

Contains fields that can be overridden when you implement your own terrain painting tools to display in Terrain overlays. When you create custom Terrain Tools, they must inherit from the TerrainPaintToolWithOverlays<T0> class rather than this class.

Properties

CategoryThe TerrainCategory that the Terrain Tool belongs to.
HasBrushAttributesTrue if the Terrain Tool has brush attributes, false otherwise.
HasBrushMaskTrue if Terrain Tool has brush masks, false otherwise.
HasToolSettingsTrue if Terrain Tool has custom settings, false otherwise.
IconIndexThe index at which you should place the Terrain Tool in the Terrain Tools overlay.
OffIconThe icon displayed in the Terrain Tools overlay when the Terrain Tool isn't selected.
OnIconThe icon displayed in the Terrain Tools overlay when the terrain tool is selected.
TerrainThe last hit terrain or the last active instance of a terrain object.

Public Methods

GetDescriptionDescription of the Terrain Tool.
GetNameName of the Terrain Tool.
OnActivatedThis function is called when the tool is activated.
OnDisableCalled when the tool is destroyed.
OnEnableCalled when the tool is created.
OnEnterToolModeThis function is called when the Terrain Tool is activated.
OnExitToolModeThis function is called when the Terrain Tool becomes inactive.
OnInspectorGUICustom Terrain Tool OnInspectorGUI callback.
OnPaintCustom Terrain Tool paint callback.
OnRenderBrushPreviewUse this method to implement custom tool preview and UI behavior that only renders while the mouse is within the SceneView bounds or while you're actively using this tool.
OnSceneGUICustom Terrain Tool OnSceneGUI callback.
OnToolGUIThis method is used to implement the custom terrain editor paint tool.
OnToolSettingsGUIContains the IMGUI code for custom settings beyond the common settings.
OnWillBeDeactivatedInvoked before the terrain paint tool with overlays stops being the active tool.

Inherited Members

Properties

gridSnapEnabledUse this property to allow the current EditorTool to enable/disable grid snapping.
targetThe object being inspected.
targetsAn array of the objects being inspected.
toolbarIconThe icon and tooltip for this custom editor tool. If this function is not implemented, the toolbar displays the Inspector icon for the target type. If no target type is defined, the toolbar displays the Tool Mode icon.
hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameThe name of the object.

Public Methods

IsAvailableChecks whether the custom editor tool is available based on the state of the editor.
GetInstanceIDGets the instance ID of the object.
ToStringReturns the name of the object.

Static Methods

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindAnyObjectByTypeRetrieves any active loaded object of Type type.
FindFirstObjectByTypeRetrieves the first active loaded object of Type type.
FindObjectsByTypeRetrieves a list of all loaded objects of Type type.
InstantiateClones the object original and returns the clone.
CreateInstanceCreates an instance of a scriptable object.

Operators

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.

Messages

AwakeThis function is called when the ScriptableObject script is started.
OnDestroyThis function is called when the scriptable object will be destroyed.
OnValidateEditor-only function that Unity calls when the script is loaded or a value changes in the Inspector.
ResetReset to default values.