using UnityEngine.UIElements; using UnityEditor.Toolbars; namespace UnityEditor.Tilemaps { /// /// A VisualElement displaying a Toolbar showing EditorTools for GridPainting. /// /// /// This shows the EditorTools available for the active Brush. /// public class GridPaintingToolbar : VisualElement { /// /// Factory for GridPaintingToolbar. /// public class GridPaintingToolbarFactory : UxmlFactory {} /// /// UxmlTraits for GridPaintingToolbar. /// public class GridPaintingToolbarUxmlTraits : UxmlTraits {} private static readonly string ussClassName = "unity-tilepalette-toolbar"; private static readonly string k_Name = L10n.Tr("Tile Palette Toolbar"); private static readonly string[] k_ToolbarElements = { TilemapEditorToolbarStrip.k_ToolbarId }; /// /// Initializes and returns an instance of GridPaintingToolbar. /// public GridPaintingToolbar() : this(null) { } /// /// Initializes and returns an instance of GridPaintingToolbar. /// /// Editor Window containing this VisualElement. public GridPaintingToolbar(EditorWindow editorWindow) { AddToClassList(ussClassName); name = k_Name; var ot = EditorToolbar.CreateOverlay(k_ToolbarElements, editorWindow); Add(ot); } } }