Class GameObjectBrushEditor
The Brush Editor for a GameObject Brush.
Inherited Members
Namespace: UnityEditor .Tilemaps
Assembly: Unity.2D.Tilemap.Extras.Editor.dll
Syntax
[CustomEditor(typeof(GameObjectBrush))]
public class GameObjectBrushEditor : GridBrushEditorBase
Properties
brush
The GameObjectBrush for this Editor
Declaration
public GameObjectBrush brush { get; }
Property Value
Type | Description |
---|---|
Game |
canChangeZPosition
Whether the GridBrush can change Z Position.
Declaration
public override bool canChangeZPosition { get; set; }
Property Value
Type | Description |
---|---|
bool |
Overrides
icon
Returns an icon identifying the GameObject Brush.
Declaration
public override Texture2D icon { get; }
Property Value
Type | Description |
---|---|
Texture2D |
Overrides
shouldSaveBrushForSelection
Whether the Brush is in a state that should be saved for selection.
Declaration
public override bool shouldSaveBrushForSelection { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
validTargets
The targets that the GameObjectBrush can paint on
Declaration
public override GameObject[] validTargets { get; }
Property Value
Type | Description |
---|---|
Game |
Overrides
Methods
OnPaintInspectorGUI()
Callback for painting the inspector GUI for the GameObjectBrush in the tilemap palette. The GameObjectBrush Editor overrides this to show the usage of this Brush.
Declaration
public override void OnPaintInspectorGUI()
Overrides
OnPaintSceneGUI(GridLayout, GameObject, BoundsInt, Tool, bool)
Callback for painting the GUI for the GridBrush in the Scene View. The GameObjectBrush Editor overrides this to draw the preview of the brush when drawing lines.
Declaration
public override void OnPaintSceneGUI(GridLayout gridLayout, GameObject brushTarget, BoundsInt position, GridBrushBase.Tool tool, bool executing)
Parameters
Type | Name | Description |
---|---|---|
Grid |
gridLayout | Grid that the brush is being used on. |
Game |
brushTarget | Target of the GameObjectBrush::ref::Tool operation. By default the currently selected GameObject. |
Bounds |
position | Current selected location of the brush. |
Grid |
tool | Current GameObjectBrush::ref::Tool selected. |
bool | executing | Whether brush is being used. |
Overrides
RenderStaticPreview(string, Object[], int, int)
Creates a static preview of the GameObjectBrush with its current selection.
Declaration
public override Texture2D RenderStaticPreview(string assetPath, Object[] subAssets, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
string | assetPath | The asset to operate on. |
Object[] | subAssets | An array of all Assets at assetPath. |
int | width | Width of the created texture. |
int | height | Height of the created texture. |
Returns
Type | Description |
---|---|
Texture2D | Generated texture or null. |