CapersProject/Assets/02.Scripts/Item/Cocktail/CocktailDataSo.cs

31 lines
782 B
C#
Raw Normal View History

2024-10-23 05:26:56 +00:00
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
namespace BlueWater.Items
{
[CreateAssetMenu(fileName = "CocktailDataTable", menuName = "ScriptableObjects/CocktailDataTable")]
public class CocktailDataSo : DataSo<CocktailData>
{
2024-11-19 01:12:01 +00:00
[field: SerializeField]
public int MaxLiquidCount { get; private set; } = 300;
2024-10-22 12:41:31 +00:00
protected override void OnEnable()
{
base.OnEnable();
2024-10-23 05:26:56 +00:00
#if UNITY_EDITOR
if (!EditorApplication.isPlayingOrWillChangePlaymode)
{
return;
}
#endif
2024-11-19 01:12:01 +00:00
foreach (var element in _datas.Values)
2024-10-22 12:41:31 +00:00
{
2024-11-19 01:12:01 +00:00
element.ValidIngredients = element.GetValidIngredients(MaxLiquidCount);
2024-10-22 12:41:31 +00:00
}
}
}
}