계산대 로직 중간저장
This commit is contained in:
@@ -16,10 +16,13 @@ public class CheckoutProductionRow : MonoBehaviour
|
||||
|
||||
public ItemData Item { get; private set; }
|
||||
public int Quantity { get; private set; }
|
||||
public int OrderNum { get; private set; } = 1;
|
||||
|
||||
public event Action<ItemData> OnAddClicked;
|
||||
public event Action<ItemData> OnRemoveClicked;
|
||||
|
||||
public void SetOrderNum(int orderNum) => OrderNum = orderNum;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (_addButton != null) _addButton.onClick.AddListener(() => OnAddClicked?.Invoke(Item));
|
||||
|
||||
25
Assets/02_Scripts/UI/CheckoutVRButton.cs
Normal file
25
Assets/02_Scripts/UI/CheckoutVRButton.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.XR.Interaction.Toolkit.UI;
|
||||
using VRShopping.Interact;
|
||||
|
||||
public class CheckoutVRButton : MonoBehaviour, IPointerClickHandler
|
||||
{
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
GameObject whatWasClicked = eventData.pointerPress;
|
||||
|
||||
if (eventData is not TrackedDeviceEventData trackedData) return;
|
||||
|
||||
var interactorMB = trackedData.interactor as MonoBehaviour;
|
||||
if (interactorMB == null) return;
|
||||
GameObject whoClicked = interactorMB.gameObject;
|
||||
|
||||
PlayerController clickPlayer = whoClicked.GetComponentInParent<PlayerController>();
|
||||
CheckoutMachine checkoutMachine = whatWasClicked.GetComponentInParent<CheckoutMachine>();
|
||||
|
||||
if (clickPlayer == null || checkoutMachine == null) return;
|
||||
|
||||
clickPlayer.Checkout(checkoutMachine);
|
||||
}
|
||||
}
|
||||
2
Assets/02_Scripts/UI/CheckoutVRButton.cs.meta
Normal file
2
Assets/02_Scripts/UI/CheckoutVRButton.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b57c28251a9ae24ea3f54a09201a948
|
||||
@@ -11,6 +11,8 @@ public class ShoppingOrderView : MonoBehaviour
|
||||
[SerializeField] private Animator _anim;
|
||||
[SerializeField] private GameObject _paper;
|
||||
|
||||
public ShoppingOrderList OrderList => _orderList;
|
||||
|
||||
private bool _visibleShoppingOrderList = false;
|
||||
|
||||
private void Start()
|
||||
|
||||
Reference in New Issue
Block a user