2025-07-23 03:27:34 +00:00
|
|
|
using System;
|
2025-07-24 08:41:20 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using TMPro;
|
|
|
|
using UnityEngine;
|
2025-07-23 03:27:34 +00:00
|
|
|
using UnityEngine.InputSystem;
|
2025-07-24 08:41:20 +00:00
|
|
|
using UnityEngine.Serialization;
|
|
|
|
using UnityEngine.UI;
|
2025-07-23 03:27:34 +00:00
|
|
|
|
|
|
|
namespace DDD
|
|
|
|
{
|
|
|
|
public class RestaurantManagementUi : PopupUi<RestaurantUiActions>
|
|
|
|
{
|
2025-07-24 08:41:20 +00:00
|
|
|
private RestaurantManagementUiConfigSo _restaurantManagementUiConfigSo;
|
|
|
|
|
|
|
|
[SerializeField]
|
|
|
|
private TabUiController _tabUiController;
|
|
|
|
|
|
|
|
[SerializeField]
|
|
|
|
private Transform _itemInventoryContent;
|
|
|
|
|
|
|
|
[SerializeField]
|
|
|
|
private TextMeshProUGUI _selectedItemNameText;
|
|
|
|
|
|
|
|
[SerializeField]
|
|
|
|
private TextMeshProUGUI _selectedDescriptionNameText;
|
|
|
|
|
|
|
|
[SerializeField]
|
|
|
|
private Image _selectedItemCookwareImage;
|
|
|
|
|
|
|
|
private List<ItemSlotUi> _itemSlotUis = new();
|
|
|
|
|
|
|
|
private const string RestaurantManagementUiConfigSo = "RestaurantManagementUiConfigSo";
|
|
|
|
|
|
|
|
protected override async void Awake()
|
|
|
|
{
|
|
|
|
base.Awake();
|
|
|
|
|
|
|
|
_restaurantManagementUiConfigSo = await AssetManager.LoadAsset<RestaurantManagementUiConfigSo>(RestaurantManagementUiConfigSo);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void Open()
|
|
|
|
{
|
|
|
|
base.Open();
|
|
|
|
|
|
|
|
_tabUiController.ActivateFirstTab();
|
|
|
|
}
|
|
|
|
|
2025-07-23 03:27:34 +00:00
|
|
|
protected override void OnInputPerformed(RestaurantUiActions actionEnum, InputAction.CallbackContext context)
|
|
|
|
{
|
|
|
|
switch (actionEnum)
|
|
|
|
{
|
|
|
|
case RestaurantUiActions.None:
|
|
|
|
break;
|
|
|
|
case RestaurantUiActions.Submit:
|
|
|
|
HandleSubmit();
|
|
|
|
break;
|
|
|
|
case RestaurantUiActions.Cancel:
|
|
|
|
HandleCancel();
|
|
|
|
break;
|
|
|
|
case RestaurantUiActions.PreviousTab:
|
|
|
|
HandleMoveTab(-1);
|
|
|
|
break;
|
|
|
|
case RestaurantUiActions.NextTab:
|
|
|
|
HandleMoveTab(1);
|
|
|
|
break;
|
|
|
|
case RestaurantUiActions.Interact1:
|
|
|
|
HandleInteract1();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
throw new ArgumentOutOfRangeException(nameof(actionEnum), actionEnum, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void HandleSubmit()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private void HandleCancel()
|
|
|
|
{
|
|
|
|
var evt = GameEvents.ClosePopupUiEvent;
|
|
|
|
evt.UiType = GetType();
|
|
|
|
EventBus.Broadcast(evt);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void HandleMoveTab(int direction)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private void HandleInteract1()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2025-07-24 08:41:20 +00:00
|
|
|
|
|
|
|
public void InitializeItemInventory()
|
|
|
|
{
|
|
|
|
for (int i = _itemInventoryContent.childCount - 1; i >= 0; i--)
|
|
|
|
{
|
|
|
|
Destroy(_itemInventoryContent.GetChild(i).gameObject);
|
|
|
|
}
|
|
|
|
|
|
|
|
_itemSlotUis.Clear();
|
|
|
|
// 레시피 만큼 생성
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Test(int a)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2025-07-23 03:27:34 +00:00
|
|
|
}
|
|
|
|
}
|