2024-10-23 05:26:56 +00:00
|
|
|
#if UNITY_EDITOR
|
|
|
|
using UnityEditor;
|
|
|
|
#endif
|
2024-08-27 12:23:41 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace BlueWater.Items
|
|
|
|
{
|
|
|
|
[CreateAssetMenu(fileName = "CocktailDataTable", menuName = "ScriptableObjects/CocktailDataTable")]
|
|
|
|
public class CocktailDataSo : DataSo<CocktailData>
|
|
|
|
{
|
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-10-22 12:41:31 +00:00
|
|
|
var maxLiquidAmount = FindAnyObjectByType<LiquidController>().GetMaxLiquidCount();
|
|
|
|
foreach (var element in _datas.Values)
|
|
|
|
{
|
|
|
|
element.ValidIngredients = element.GetValidIngredients(maxLiquidAmount);
|
|
|
|
}
|
|
|
|
}
|
2024-10-23 05:26:56 +00:00
|
|
|
|
|
|
|
|
2024-08-27 12:23:41 +00:00
|
|
|
}
|
|
|
|
}
|