57 lines
1.8 KiB
C#
57 lines
1.8 KiB
C#
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
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.HideCountText();
|
|
ui.HideMark();
|
|
ui.SetButtonInteractable(false);
|
|
|
|
return;
|
|
}
|
|
|
|
string markSpriteKey = null;
|
|
if (RestaurantState.instance.ManagementState.IsCookwareMatched(ui.Model.Id))
|
|
{
|
|
markSpriteKey = SpriteConstants.CheckYesSpriteKey;
|
|
}
|
|
else
|
|
{
|
|
markSpriteKey = SpriteConstants.CheckNoSpriteKey;
|
|
}
|
|
ui.SetIcon(model.ItemSprite);
|
|
ui.HideCountText();
|
|
ui.ShowMark(DataManager.Instance.GetSprite(markSpriteKey));
|
|
ui.SetButtonInteractable(true);
|
|
}
|
|
|
|
public RuntimeAnimatorController GetAnimatorController()
|
|
{
|
|
return RestaurantDataSo.instance.ManagementData.TodayMenuSlotUiAnimatorController;
|
|
}
|
|
}
|
|
} |