Нема описа
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using UnityEngine.UIElements;
  2. using UnityEditor.Toolbars;
  3. using System;
  4. namespace UnityEditor.Tilemaps
  5. {
  6. /// <summary>
  7. /// A VisualElement displaying a Toolbar showing EditorTools for GridPainting.
  8. /// </summary>
  9. /// <description>
  10. /// This shows the EditorTools available for the active Brush.
  11. /// </description>
  12. [UxmlElement]
  13. public partial class GridPaintingToolbar : VisualElement
  14. {
  15. /// <summary>
  16. /// Factory for GridPaintingToolbar.
  17. /// </summary>
  18. [Obsolete("GridPaintingToolbarFactory is deprecated and will be removed. Use UxmlElementAttribute instead.", false)]
  19. public class GridPaintingToolbarFactory : UxmlFactory<GridPaintingToolbar, GridPaintingToolbarUxmlTraits> {}
  20. /// <summary>
  21. /// UxmlTraits for GridPaintingToolbar.
  22. /// </summary>
  23. [Obsolete("GridPaintingToolbarUxmlTraits is deprecated and will be removed. Use UxmlElementAttribute instead.", false)]
  24. public class GridPaintingToolbarUxmlTraits : UxmlTraits {}
  25. private static readonly string ussClassName = "unity-tilepalette-toolbar";
  26. private static readonly string k_Name = L10n.Tr("Tile Palette Toolbar");
  27. private static readonly string[] k_ToolbarElements = { TilemapEditorToolbarStrip.k_ToolbarId };
  28. /// <summary>
  29. /// Initializes and returns an instance of GridPaintingToolbar.
  30. /// </summary>
  31. public GridPaintingToolbar() : this(null) { }
  32. /// <summary>
  33. /// Initializes and returns an instance of GridPaintingToolbar.
  34. /// </summary>
  35. /// <param name="editorWindow">Editor Window containing this VisualElement.</param>
  36. public GridPaintingToolbar(EditorWindow editorWindow)
  37. {
  38. AddToClassList(ussClassName);
  39. name = k_Name;
  40. var ot = EditorToolbar.CreateOverlay(k_ToolbarElements, editorWindow);
  41. Add(ot);
  42. }
  43. }
  44. }