요리 더미 로직 연결

This commit is contained in:
NTG 2025-08-29 13:28:03 +09:00
parent 6929728b23
commit 16415ac426
5 changed files with 29 additions and 11 deletions

View File

@ -24,12 +24,11 @@ public bool IsCancelButtonVisible
public override void Initialize()
{
base.Initialize();
}
public override void Cleanup()
{
base.Cleanup();
_onCancel = null;
_onConfirm = null;
}

View File

@ -31,7 +31,7 @@ protected override void OnCreatedInitializeBasePopup()
protected override void OnOpenedEventsBasePopup(OpenPopupUiEvent evt)
{
_viewModel?.Initialize();
_viewModel.Initialize();
if (_viewModel && _bindingContext != null)
{
@ -92,7 +92,7 @@ protected override void OnClosedEventsBasePopup(ClosePopupUiEvent evt)
}
OnClosedEventsPopup(evt);
_viewModel?.Cleanup();
_viewModel.Cleanup();
}
private void OnInputStarted(TInputEnum actionEnum, InputAction.CallbackContext context)

View File

@ -119,7 +119,8 @@ private void HandleInteract1()
private void HandleInteract2()
{
// TODO : 요리 선택 (미니게임 더미 연출)
_viewModel.OnStartedCooking?.Invoke();
Close();
}
private void OnAddedCookTabSelected(int index)

View File

@ -67,9 +67,6 @@ public SelectedCookSnapshot SelectedCookSnapshot
public ItemSlotUi SelectedCookSlot { get; private set; }
private RestaurantManagementData GetRestaurantManagementData() => RestaurantData.Instance.ManagementData;
private RestaurantManagementState GetRestaurantManagementState() => RestaurantState.Instance.ManagementState;
private int _currentCookIndex = -1;
public int CurrentCookIndex
{
@ -81,7 +78,20 @@ public int CurrentCookIndex
private InventorySortType _currentSortType = InventorySortType.None;
public event Action OnAddedIngredients;
public Action OnStartedCooking;
public override void Initialize()
{
OnStartedCooking += StartCooking;
}
public override void Cleanup()
{
OnStartedCooking -= StartCooking;
}
private RestaurantManagementData GetRestaurantManagementData() => RestaurantData.Instance.ManagementData;
private RestaurantManagementState GetRestaurantManagementState() => RestaurantState.Instance.ManagementState;
public GameObject GetInitialSelected() => _addedCookItemSlots[0].gameObject;
public void SetCookwareType(CookwareType cookwareType)
@ -249,5 +259,16 @@ private void UpdateSelectedCook()
tastes: tastes,
tasteMaterial: tasteMat);
}
private void StartCooking()
{
// TODO : 플레이어가 선택된 요리 들기
// TODO : 미니 게임 메세지로 대체 (임시)
var evt = GameEvents.ShowGlobalMessageEvent;
evt.Set("cooking_minigame_dummy_message", 2f, newTextColor: Color.green);
EventBus.Broadcast(evt);
}
}
}

View File

@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Localization;
namespace DDD.Restaurant
{
@ -24,14 +23,12 @@ public class RestaurantManagementViewModel : SimpleViewModel, IEventHandler<Toda
public override void Initialize()
{
base.Initialize();
RegisterEvents();
ResetHoldState();
}
public override void Cleanup()
{
base.Cleanup();
UnregisterEvents();
}