ProjectDDD/Assets/_DDD/_Scripts/GameUi/New/TodayMenuSlotUiStrategy.cs

38 lines
1.2 KiB
C#

namespace DDD
{
public class TodayMenuSlotUiStrategy : IItemSlotUiStrategy
{
private readonly RecipeType _recipeType;
public TodayMenuSlotUiStrategy(RecipeType recipeType)
{
_recipeType = recipeType;
}
public void Setup(ItemSlotUi ui, ItemViewModel model)
{
if (model == null)
{
string emptySpriteKey = null;
if (_recipeType == RecipeType.FoodRecipe)
{
emptySpriteKey = SpriteConstants.EmptyFoodSpriteKey;
}
else if (_recipeType == RecipeType.DrinkRecipe)
{
emptySpriteKey = SpriteConstants.EmptyDrinkSpriteKey;
}
ui.SetIcon(DataManager.Instance.GetSprite(emptySpriteKey));
ui.HideCount();
ui.HideMark();
ui.SetButtonInteractable(false);
return;
}
ui.SetIcon(model.ItemSprite);
ui.HideCount();
ui.ShowMark(DataManager.Instance.GetSprite(SpriteConstants.CheckNoSpriteKey)); // TODO : 추후에 장비와 매칭
ui.SetButtonInteractable(true);
}
}
}