diff --git a/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmViewModel.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmViewModel.cs index 7a2f72965..cc9b5dba4 100644 --- a/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmViewModel.cs +++ b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/ConfirmUi/ConfirmViewModel.cs @@ -24,12 +24,11 @@ public bool IsCancelButtonVisible public override void Initialize() { - base.Initialize(); + } public override void Cleanup() { - base.Cleanup(); _onCancel = null; _onConfirm = null; } diff --git a/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/PopupUi.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/PopupUi.cs index ab077816e..3f9e3fcaa 100644 --- a/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/PopupUi.cs +++ b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/PopupUis/PopupUi.cs @@ -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) diff --git a/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookUi.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookUi.cs index ffb92e50e..e217a8cae 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookUi.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookUi.cs @@ -119,7 +119,8 @@ private void HandleInteract1() private void HandleInteract2() { - // TODO : 요리 선택 (미니게임 더미 연출) + _viewModel.OnStartedCooking?.Invoke(); + Close(); } private void OnAddedCookTabSelected(int index) diff --git a/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookViewModel.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookViewModel.cs index d0ef8f05c..5cbe6d677 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookViewModel.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookViewModel.cs @@ -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); + } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementViewModel.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementViewModel.cs index 8f4c71065..ce0690399 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementViewModel.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/RestaurantManagementUi/RestaurantManagementViewModel.cs @@ -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