2026-04-22 계산대 프로토 타입
This commit is contained in:
30
Assets/02_Scripts/UI/CheckoutProductionRow.cs
Normal file
30
Assets/02_Scripts/UI/CheckoutProductionRow.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using VRShopping.Items;
|
||||
|
||||
namespace VRShopping.UI
|
||||
{
|
||||
public class CheckoutProductionRow : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private TMP_Text _nameText;
|
||||
[SerializeField] private TMP_Text _quantityText;
|
||||
[SerializeField] private TMP_Text _priceText;
|
||||
|
||||
public int Quantity { get; private set; }
|
||||
|
||||
public void Bind(ItemData item, int quantity)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Quantity = quantity;
|
||||
|
||||
if (_nameText != null) _nameText.text = item.DisplayName;
|
||||
if (_quantityText != null) _quantityText.text = $"x{quantity}";
|
||||
if (_priceText != null) _priceText.text = (item.FinalPrice * quantity).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/02_Scripts/UI/CheckoutProductionRow.cs.meta
Normal file
2
Assets/02_Scripts/UI/CheckoutProductionRow.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92bbb02bca8248745bf81725ed4e0423
|
||||
Reference in New Issue
Block a user