using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace BulletHellTemplate
{
public class ShopBuyPopup : MonoBehaviour
{
public Image shopItemIcon;
public TextMeshProUGUI shopItemName;
public TextMeshProUGUI shopItemDescription;
private string itemId;
///
/// Sets the information for the purchase confirmation popup.
/// This method configures the popup with the item ID, name, description, and icon.
///
/// The ID of the item to be purchased.
/// The name of the item to be displayed.
/// The description of the item to be displayed.
/// The icon of the item to be displayed.
public void SetPopupInfo(string _itemId, string _itemName, string _itemDescription, Sprite itemIcon)
{
itemId = _itemId;
shopItemName.text = _itemName;
shopItemDescription.text = _itemDescription;
shopItemIcon.sprite = itemIcon;
}
///
/// Confirms the purchase of the item.
/// This method triggers the item purchase confirmation process and deactivates the popup.
///
public void ConfirmBuy()
{
UIShopMenu.Singleton.BuyItemConfirm(itemId);
gameObject.SetActive(false);
}
}
}