GridBrushEditorBase
All brush editors added must inherit from GridBrushEditorBase
. GridBrushEditorBase
provides a fixed set of APIs for drawing of inspectors on the Palette window and drawing of Gizmos on the Scene View.
public virtual GameObject[] validTargets
This returns a list of GameObjects which are valid targets to be painted on by the brush. This appears in the dropdown in the Palette window. Override this to have a custom list of targets which this Brush can interact with.
public virtual void OnPaintInspectorGUI()
This displays an inspector for editing Brush options in the Palette. Use this to update brush functionality while editing in the Scene view.
public virtual void OnSelectionInspectorGUI()
This displays an inspector for when cells are selected on a target Grid. Override this to show a custom inspector view for the selected cells.
public virtual void OnPaintSceneGUI(GridLayout grid, GameObject brushTarget, BoundsInt position, GridBrushBase.Tool tool, bool executing)
This is used for drawing additional gizmos on the Scene View when painting with the brush. Tool is the currently selected tool in the Palette. Executing returns whether the brush is being used at the particular time.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thanks for helping to make the Unity documentation better!