31 lines
776 B
C#
31 lines
776 B
C#
#if UNITY_EDITOR
|
|
using UnityEditor;
|
|
#endif
|
|
using UnityEngine;
|
|
|
|
namespace DDD.Items
|
|
{
|
|
[CreateAssetMenu(fileName = "CocktailDataTable", menuName = "ScriptableObjects/CocktailDataTable")]
|
|
public class CocktailDataSo : DataSo<CocktailData>
|
|
{
|
|
[field: SerializeField]
|
|
public int MaxLiquidCount { get; private set; } = 300;
|
|
|
|
protected override void OnEnable()
|
|
{
|
|
base.OnEnable();
|
|
|
|
#if UNITY_EDITOR
|
|
if (!EditorApplication.isPlayingOrWillChangePlaymode)
|
|
{
|
|
return;
|
|
}
|
|
#endif
|
|
|
|
foreach (var element in _datas.Values)
|
|
{
|
|
element.ValidIngredients = element.GetValidIngredients(MaxLiquidCount);
|
|
}
|
|
}
|
|
}
|
|
} |