diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemDetailView.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemDetailView.cs index 5b96ae205..434281a84 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemDetailView.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemDetailView.cs @@ -77,7 +77,7 @@ public async void Show(ItemViewModel model) } _labelLocalizer.StringReference = LocalizationManager.Instance.GetLocalizedName(viewItemKey); _descriptionLocalizer.StringReference = LocalizationManager.Instance.GetLocalizedDescription(viewItemKey); - _cookwareImage.sprite = _currentItemViewModel.GetCookwareSprite; + _cookwareImage.sprite = _currentItemViewModel.GetCookwareIcon; UpdateTasteHashTags(_currentItemViewModel); } diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemUi/ItemViewModel.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemUi/ItemViewModel.cs index b5b4938f0..247fa016a 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemUi/ItemViewModel.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/ItemUi/ItemViewModel.cs @@ -46,27 +46,6 @@ public Sprite ItemSprite return DataManager.Instance.GetSprite(Id); } } - - public Sprite GetCookwareSprite - { - get - { - if (ItemType != ItemType.Recipe) return null; - - string cookwareSpriteKey = null; - switch (RecipeType) - { - case RecipeType.FoodRecipe: - cookwareSpriteKey = DataManager.Instance.GetDataSo().GetDataById(GetRecipeResultKey).CookwareKey; - break; - case RecipeType.DrinkRecipe: - cookwareSpriteKey = DataManager.Instance.GetDataSo().GetDataById(GetRecipeResultKey).CookwareKey; - break; - } - return DataManager.Instance.GetSprite(cookwareSpriteKey); - } - } - public string GetRecipeResultKey { get @@ -76,6 +55,27 @@ public string GetRecipeResultKey return DataManager.Instance.GetDataSo().GetDataById(Id).RecipeResult; } } + + public Sprite GetCookwareIcon + { + get + { + var resultKey = GetRecipeResultKey; + if (resultKey == null) return null; + + string cookwareKey = null; + if (RecipeType == RecipeType.FoodRecipe) + { + cookwareKey = DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey; + } + else if (RecipeType == RecipeType.DrinkRecipe) + { + cookwareKey = DataManager.Instance.GetDataSo().GetDataById(resultKey).CookwareKey; + } + return DataManager.Instance.GetIcon(cookwareKey); + } + } + public List GetTasteDatas {