ProjectDDD/Assets/_DDD/_Scripts/Restaurant/Ui/Hud/BillHud.cs

24 lines
637 B
C#
Raw Normal View History

2025-08-29 07:51:48 +00:00
using System;
using UnityEngine;
using UnityEngine.UI;
namespace DDD.Restaurant
{
public class BillHud : MonoBehaviour, IEventHandler<RestaurantOrderEvent>
{
[SerializeField] private RectTransform _billItemsLayoutTransform;
[SerializeField] private GameObject _billItemPrefab;
private void Start()
{
EventBus.Register(this);
Utils.DestroyAllChildren(_billItemsLayoutTransform);
}
public void HandleEvent(RestaurantOrderEvent evt)
{
var billItem = Instantiate(_billItemPrefab, _billItemsLayoutTransform);
}
}
}