Class GridBrushEditorBase
Base class for Grid Brush Editor.
Inherited Members
Namespace: UnityEditor.Tilemaps
Assembly: Unity.2D.Tilemap.Editor.dll
Syntax
[MovedFrom(true, "UnityEditor", "UnityEditor", null)]
[CustomEditor(typeof(GridBrushBase))]
public class GridBrushEditorBase : Editor
Properties
canChangeZPosition
Checks if the Brush allows the changing of Z Position.
Declaration
public virtual bool canChangeZPosition { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | Whether the Brush can change Z Position. |
icon
Returns a texture used as an icon to identify this brush.
Declaration
public virtual Texture2D icon { get; }
Property Value
| Type | Description |
|---|---|
| Texture2D |
shouldSaveBrushForSelection
Whether the Brush is in a state that should be saved for selection.
Declaration
public virtual bool shouldSaveBrushForSelection { get; }
Property Value
| Type | Description |
|---|---|
| bool |
tooltip
Returns a tooltip describing the usage of the brush and other helpful information.
Declaration
public virtual string tooltip { get; }
Property Value
| Type | Description |
|---|---|
| string |
validTargets
Returns all valid targets that the brush can edit.
Declaration
public virtual GameObject[] validTargets { get; }
Property Value
| Type | Description |
|---|---|
| GameObject[] |
Methods
OnMouseEnter()
Callback when the mouse cursor enters a paintable region.
Declaration
public virtual void OnMouseEnter()
Remarks
Implement this for any custom behaviour when the mouse cursor enters a paintable region.
OnMouseLeave()
Callback when the mouse cursor leaves a paintable region.
Declaration
public virtual void OnMouseLeave()
Remarks
Implement this for any custom behaviour when the mouse cursor leaves a paintable region.
OnPaintInspectorGUI()
Callback for painting the inspector GUI for the GridBrush in the tilemap palette.
Declaration
public virtual void OnPaintInspectorGUI()
Remarks
Implement this to have a custom editor in the tilemap palette for the GridBrush.
OnPaintSceneGUI(GridLayout, GameObject, BoundsInt, Tool, bool)
Callback for painting the GUI for the GridBrush in the Scene view.
Declaration
public virtual void OnPaintSceneGUI(GridLayout gridLayout, GameObject brushTarget, BoundsInt position, GridBrushBase.Tool tool, bool executing)
Parameters
| Type | Name | Description |
|---|---|---|
| GridLayout | gridLayout | Grid that the brush is being used on. |
| GameObject | brushTarget | Target of the GridBrushBase::ref::Tool operation. By default the currently selected GameObject. |
| BoundsInt | position | Current selected location of the brush. |
| GridBrushBase.Tool | tool | Current GridBrushBase::ref::Tool selected. |
| bool | executing | Whether is brush is being used. |
Remarks
Implement this for any special behaviours when the GridBrush is used on the Scene View.
OnSceneGUI(GridLayout, GameObject)
Callback for painting custom gizmos for the GridBrush for the brush target
Declaration
public virtual void OnSceneGUI(GridLayout gridLayout, GameObject brushTarget)
Parameters
| Type | Name | Description |
|---|---|---|
| GridLayout | gridLayout | Grid that the brush is being used on. |
| GameObject | brushTarget | Target of the GridBrushBase::ref::Tool operation. By default the currently selected GameObject. |
Remarks
Override this to show custom gizmos for the brush target.
OnSelectionInspectorGUI()
Callback for drawing the Inspector GUI when there is an active GridSelection made in a GridLayout.
Declaration
public virtual void OnSelectionInspectorGUI()
Remarks
Override this to show custom Inspector GUI for the current selection.
OnSelectionSceneGUI(GridLayout, GameObject)
Callback for painting custom gizmos when there is an active GridSelection made in a GridLayout.
Declaration
public virtual void OnSelectionSceneGUI(GridLayout gridLayout, GameObject brushTarget)
Parameters
| Type | Name | Description |
|---|---|---|
| GridLayout | gridLayout | Grid that the brush is being used on. |
| GameObject | brushTarget | Target of the GridBrushBase::ref::Tool operation. By default the currently selected GameObject. |
Remarks
Override this to show custom gizmos for the current selection.
OnToolActivated(Tool)
Callback when a GridBrushBase.Tool is activated.
Declaration
public virtual void OnToolActivated(GridBrushBase.Tool tool)
Parameters
| Type | Name | Description |
|---|---|---|
| GridBrushBase.Tool | tool | Tool that is activated. |
Remarks
Implement this for any special behaviours when a Tool is activated.
OnToolDeactivated(Tool)
Callback when a GridBrushBase.Tool is deactivated.
Declaration
public virtual void OnToolDeactivated(GridBrushBase.Tool tool)
Parameters
| Type | Name | Description |
|---|---|---|
| GridBrushBase.Tool | tool | Tool that is deactivated. |
Remarks
Implement this for any special behaviours when a Tool is deactivated.
RegisterUndo(GameObject, Tool)
Callback for registering an Undo action before the GridBrushBase does the current GridBrushBase::ref::Tool action.
Declaration
public virtual void RegisterUndo(GameObject brushTarget, GridBrushBase.Tool tool)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | brushTarget | Target of the GridBrushBase::ref::Tool operation. By default the currently selected GameObject. |
| GridBrushBase.Tool | tool | Current GridBrushBase::ref::Tool selected. |
Remarks
Implement this for any special Undo behaviours when a brush is used.