I would like to be able to add my own gizmos, labels, etc to the “scene” or window the tile palette runs in. While this functionality does appear to exist in OnPaintSceneGui(),
OnPaintSceneGui()
public override void OnPaintSceneGUI(GridLayout grid, GameObject brushTarget, BoundsInt position, GridBrushBase.Tool tool, bool executing)
{
base.OnPaintSceneGUI(grid, brushTarget, position, tool, executing);
//if (brushTarget.scene.name != "Preview Scene") {
// Handles.Label(grid.CellToWorld(position.position), position.position.AsVector2Int().ToString());
//}
//else
//{
var tileName = ((AdvancedTileBrush)target).cells[0]?.tile?.name;
//if (tileName != null)
//{
Handles.Label(
grid.CellToWorld(position.position)
, "test",//tileName,
new GUIStyle
{
fontSize = 30,
fontStyle = FontStyle.Bold,
normal = new GUIStyleState { textColor = Color.white }
});
//}
//}
}
I have found that it only works for the select tool and somewhat randomly at that - the label is only drawn sometimes:
In my case, the label only appears when I have the select tool enabled and when I click on a tile. Furthermore, the label is not always visible for every tile. The label should always be shown.
Something like this is what I want - The ability to add text or gizmos:
Just to reiterate, I want to have the same capability for scene tooling that exists in any standard scene. The tile palette seems to run in its own weird “Preview Scene” so technically, this should already be possible.