From 6037cd4d634eaad27a7f62bb35414a95f489b173 Mon Sep 17 00:00:00 2001 From: NTG Date: Thu, 28 Aug 2025 20:19:37 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B3=91=ED=95=A9=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EB=B0=8F=20GetLocalizedString=20null=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GameFramework/Localization/LocalizationManager.cs | 2 ++ .../BaseUi/InteractionUis/InteractionMessageUi.cs | 11 ++++++----- .../Interactions/InteractionSubsystem_Cook.cs | 5 +++++ .../RestaurantCookSolver_OpenCookUi.cs | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationManager.cs b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationManager.cs index e43ed2d8a..1eef04352 100644 --- a/Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationManager.cs +++ b/Assets/_DDD/_Scripts/Game/GameFramework/Localization/LocalizationManager.cs @@ -70,6 +70,8 @@ public void PostInit() /// public LocalizedString GetLocalizedString(string key) { + if (string.IsNullOrWhiteSpace(key)) return null; + if (!_isInitialized) { Debug.LogWarning("[LocalizationManager] 호출 전에 초기화되지 않았습니다."); diff --git a/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs index 9062a088b..71d35b969 100644 --- a/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs +++ b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/InteractionUis/InteractionMessageUi.cs @@ -47,13 +47,14 @@ public void HandleEvent(HideInteractionUiEvent evt) private void ShowInteractionUiEvent(ShowInteractionUiEvent evt) { - _previousLocalizedString = LocalizationManager.Instance.GetLocalizedString(evt.TextKey); - _textLabel.color = evt.CanInteract ? _canInteractTextColor : _cannotInteractTextColor; - - if (_textLabelLocalizeStringEvent.StringReference != _previousLocalizedString) + var currentLocalizedString = LocalizationManager.Instance.GetLocalizedString(evt.TextKey); + if (currentLocalizedString != _previousLocalizedString) { - _textLabelLocalizeStringEvent.StringReference = _previousLocalizedString; + _textLabelLocalizeStringEvent.StringReference = currentLocalizedString; + _previousLocalizedString = LocalizationManager.Instance.GetLocalizedString(evt.TextKey); } + + _textLabel.color = evt.CanInteract ? _canInteractTextColor : _cannotInteractTextColor; _filledImage.fillAmount = evt.HoldProgress; if (_panel.activeInHierarchy == false) diff --git a/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Cook.cs b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Cook.cs index b70a77aec..c72d3ad23 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Cook.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Environment/Interactions/InteractionSubsystem_Cook.cs @@ -37,5 +37,10 @@ public virtual bool OnInteracted(IInteractor interactor, ScriptableObject payloa { return true; } + + public string GetCurrentSubsystemTypeName() + { + return _cookType.ToString(); + } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs index 55c89e123..190249fc1 100644 --- a/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs +++ b/Assets/_DDD/_Scripts/Restaurant/Event/Solvers/RestaurantCooks/RestaurantCookSolver_OpenCookUi.cs @@ -24,7 +24,7 @@ public bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInter if (iCookware == null) return false; var interactableCookwareType = iCookware.CookwareType; - if (DataManager.Instance.GetDataSo().TryGetValueByCookwareType(interactableCookwareType, out var cookwareData) == false) + if (DataManager.Instance.GetDataAsset().TryGetValueByCookwareType(interactableCookwareType, out var cookwareData) == false) { return false; }