暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

TilePaletteActiveTargetsButton.cs 823B

1234567891011121314151617181920212223242526
  1. using UnityEditor.Toolbars;
  2. using UnityEngine.UIElements;
  3. namespace UnityEditor.Tilemaps
  4. {
  5. [EditorToolbarElement(k_ToolbarId)]
  6. internal class TilePaletteActiveTargetsButton : EditorToolbarDropdown
  7. {
  8. internal const string k_ToolbarId = "Tile Palette/Active Targets Button";
  9. private const string k_IconPath = "Packages/com.unity.2d.tilemap/Editor/Icons/Tilemap.ActiveTargetLayers.png";
  10. public TilePaletteActiveTargetsButton()
  11. {
  12. TilePaletteOverlayUtility.SetStyleSheet(this);
  13. icon = EditorGUIUtility.LoadIcon(k_IconPath);
  14. clicked += OnClicked;
  15. }
  16. private void OnClicked()
  17. {
  18. IGenericMenu menu = new TilePaletteActiveTargetsDropdownMenu();
  19. menu.DropDown(worldBound, this, true);
  20. }
  21. }
  22. }