2026-04-17 장보기 목록 버튼 할당 진행중
This commit is contained in:
@@ -9,7 +9,7 @@ public class ItemInfoPanel : MonoBehaviour
|
||||
{
|
||||
[Header("Refs")]
|
||||
[SerializeField] private GameObject _root;
|
||||
[SerializeField] private Image _iconImage;
|
||||
//[SerializeField] private Image _iconImage;
|
||||
[SerializeField] private TMP_Text _nameText;
|
||||
[SerializeField] private TMP_Text _brandText;
|
||||
[SerializeField] private TMP_Text _priceText;
|
||||
@@ -31,11 +31,13 @@ public void Show(ItemData data)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
if (_iconImage != null)
|
||||
{
|
||||
_iconImage.sprite = data.Icon;
|
||||
_iconImage.enabled = data.Icon != null;
|
||||
}
|
||||
*/
|
||||
|
||||
if (_nameText != null) _nameText.text = data.DisplayName;
|
||||
if (_brandText != null) _brandText.text = data.Brand;
|
||||
|
||||
24
Assets/02_Scripts/UI/ShoppingOrderRow.cs
Normal file
24
Assets/02_Scripts/UI/ShoppingOrderRow.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using VRShopping.Shopping;
|
||||
|
||||
namespace VRShopping.UI
|
||||
{
|
||||
public class ShoppingOrderRow : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private TMP_Text _nameText;
|
||||
[SerializeField] private TMP_Text _quantityText;
|
||||
|
||||
public void Bind(ShoppingOrderEntry entry)
|
||||
{
|
||||
if (entry == null)
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_nameText != null) _nameText.text = entry.ProductGroup.ToString();
|
||||
if (_quantityText != null) _quantityText.text = $"x{entry.RequiredQuantity}";
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/02_Scripts/UI/ShoppingOrderRow.cs.meta
Normal file
2
Assets/02_Scripts/UI/ShoppingOrderRow.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83f128a612dc1154e829fd29b9537948
|
||||
33
Assets/02_Scripts/UI/ShoppingOrderView.cs
Normal file
33
Assets/02_Scripts/UI/ShoppingOrderView.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
using VRShopping.Shopping;
|
||||
|
||||
namespace VRShopping.UI
|
||||
{
|
||||
public class ShoppingOrderView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private ShoppingOrderList _orderList;
|
||||
[SerializeField] private ShoppingOrderRow _rowPrefab;
|
||||
[SerializeField] private Transform _rowContainer;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Rebuild();
|
||||
}
|
||||
|
||||
public void Rebuild()
|
||||
{
|
||||
if (_orderList == null || _rowPrefab == null || _rowContainer == null) return;
|
||||
|
||||
for (int i = _rowContainer.childCount - 1; i >= 0; i--)
|
||||
{
|
||||
Destroy(_rowContainer.GetChild(i).gameObject);
|
||||
}
|
||||
|
||||
foreach (var entry in _orderList.Entries)
|
||||
{
|
||||
var row = Instantiate(_rowPrefab, _rowContainer);
|
||||
row.Bind(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/02_Scripts/UI/ShoppingOrderView.cs.meta
Normal file
2
Assets/02_Scripts/UI/ShoppingOrderView.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7cc0bf1dd5e1c2a459d8fb6ace6a166a
|
||||
Reference in New Issue
Block a user