49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
using UnityEngine;
|
|
|
|
namespace DDD.Restaurant
|
|
{
|
|
public class AddedCookSlotUiStrategy : IItemSlotUiStrategy
|
|
{
|
|
private readonly RecipeType _recipeType;
|
|
|
|
public AddedCookSlotUiStrategy(RecipeType recipeType)
|
|
{
|
|
_recipeType = recipeType;
|
|
}
|
|
|
|
public void Setup(ItemSlotUi ui, ItemModel 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);
|
|
ui.SetCommonButtonUsed(false);
|
|
|
|
return;
|
|
}
|
|
|
|
ui.SetIcon(model.ItemSprite);
|
|
ui.ShowCountText();
|
|
ui.HideMark();
|
|
ui.SetButtonInteractable(true);
|
|
ui.SetCommonButtonUsed(true);
|
|
}
|
|
|
|
public RuntimeAnimatorController GetAnimatorController()
|
|
{
|
|
return RestaurantData.Instance.ManagementData.InventorySlotUiAnimatorController;
|
|
}
|
|
}
|
|
} |