From 362444c1a5c4c5dcbf8230e2e73fde1eeeef87b0 Mon Sep 17 00:00:00 2001 From: NTG Date: Fri, 29 Aug 2025 19:02:51 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9A=94=EB=A6=AC=EC=97=90=20=EB=A7=90?= =?UTF-8?q?=ED=92=8D=EC=84=A0=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Restaurant/Ui/CookUi/CookViewModel.cs | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookViewModel.cs b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookViewModel.cs index 5cbe6d677..15e84c501 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookViewModel.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Ui/CookUi/CookViewModel.cs @@ -262,11 +262,34 @@ private void UpdateSelectedCook() private void StartCooking() { - // TODO : 플레이어가 선택된 요리 들기 - - - // TODO : 미니 게임 메세지로 대체 (임시) var evt = GameEvents.ShowGlobalMessageEvent; + var cookingModel = SelectedCookSlot.Model; + var recipeId = cookingModel.Id; + if (GetRestaurantManagementState().TryCookingById(recipeId) == false) + { + // TODO : 메세지 (임시) + evt.Set("cooking_failed_dummy_message", newTextColor: Color.red); + EventBus.Broadcast(evt); + return; + } + + var carrier = PlayerManager.Instance.GetPlayer().GetComponent(); + if (carrier == null) + { + Debug.LogError("플레이어 오브젝트에 ICarrier 인터페이스를 찾을 수 없습니다."); + return; + } + + var newVirtualCarriable = new VirtualItem(cookingModel.GetRecipeResultKey); + if (carrier.CanCarryTo(newVirtualCarriable) == false) + { + Debug.Log("플레이어가 해당 오브젝트를 들 수 없는 상태입니다."); + return; + } + + carrier.Carry(newVirtualCarriable); + + // TODO : 미니 게임 메세지로 대체 (임시) evt.Set("cooking_minigame_dummy_message", 2f, newTextColor: Color.green); EventBus.Broadcast(evt); }