wuxianshengcong/Library/PackageCache/com.unity.2d.tilemap@1.0.0/Editor/UI/TilePaletteActiveTargetsButton.cs

27 lines
823 B
C#
Raw Normal View History

2025-01-02 14:49:00 +08:00
using UnityEditor.Toolbars;
using UnityEngine.UIElements;
namespace UnityEditor.Tilemaps
{
[EditorToolbarElement(k_ToolbarId)]
internal class TilePaletteActiveTargetsButton : EditorToolbarDropdown
{
internal const string k_ToolbarId = "Tile Palette/Active Targets Button";
private const string k_IconPath = "Packages/com.unity.2d.tilemap/Editor/Icons/Tilemap.ActiveTargetLayers.png";
public TilePaletteActiveTargetsButton()
{
TilePaletteOverlayUtility.SetStyleSheet(this);
icon = EditorGUIUtility.LoadIcon(k_IconPath);
clicked += OnClicked;
}
private void OnClicked()
{
IGenericMenu menu = new TilePaletteActiveTargetsDropdownMenu();
menu.DropDown(worldBound, this, true);
}
}
}