using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Vanguard.UI.Overlays { public sealed class CardActionMenuItem { public CardActionMenuItem(string label, Action action, bool enabled = true) { Label = label; Action = action; Enabled = enabled; } public string Label { get; } public Action Action { get; } public bool Enabled { get; } } /// Экранное контекстное меню над картой. public sealed class CardActionMenuView { private RectTransform _root; private RectTransform _popup; private Action _onClose; public bool IsVisible => _root != null && _root.gameObject.activeSelf; public RectTransform Root => _root; public void Build(Transform parent) { var prefabRoot = OverlayPrefabs.Instantiate("CardActionMenu", parent); if (prefabRoot != null) { _root = prefabRoot; _popup = (RectTransform)_root.Find("Popup"); WireBackdrop(); _root.gameObject.SetActive(false); return; } _root = UiKit.CreatePanel(parent, "CardActionMenu", new Color(0f, 0f, 0f, 0.01f)); var image = _root.GetComponent(); image.raycastTarget = true; var backdrop = _root.gameObject.AddComponent