2025-08-26 04:59:03 +00:00
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
2025-08-27 07:52:34 +00:00
|
|
|
namespace DDD.Restaurant
|
2025-08-26 04:59:03 +00:00
|
|
|
{
|
|
|
|
public class SelectedIngredient : MonoBehaviour
|
|
|
|
{
|
|
|
|
[field: SerializeField] public Image IngredientImage { get; set; }
|
|
|
|
|
|
|
|
public void Initialize()
|
|
|
|
{
|
|
|
|
SetActive(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void SetActive(bool active) => IngredientImage.gameObject.SetActive(active);
|
|
|
|
|
|
|
|
public void SetIngredientEntry(IngredientEntry ingredientEntry)
|
|
|
|
{
|
2025-08-26 09:56:40 +00:00
|
|
|
if (ingredientEntry == null)
|
|
|
|
{
|
|
|
|
IngredientImage.sprite = null;
|
|
|
|
SetActive(false);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
IngredientImage.sprite = DataManager.Instance.GetSprite(ingredientEntry.IngredientId);
|
2025-08-26 04:59:03 +00:00
|
|
|
SetActive(IngredientImage.sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|