0.3.2.2 업데이트

This commit is contained in:
Nam Tae Gun 2024-10-23 14:26:56 +09:00
parent 9b82a39ff1
commit 99a8e9b653
3 changed files with 14 additions and 4 deletions

View File

@ -53,6 +53,7 @@ namespace BlueWater.Items
[field: SerializeField, BoxGroup("직접 추가하는 영역")]
public Sprite Sprite { get; set; }
[field: SerializeField]
public List<CocktailIngredient> ValidIngredients { get; set; } = new(5);
public List<CocktailIngredient> GetValidIngredients(int liquidMaxAmount)

View File

@ -1,3 +1,6 @@
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
namespace BlueWater.Items
@ -7,15 +10,23 @@ namespace BlueWater.Items
{
protected override void OnEnable()
{
if (!Application.isPlaying) return;
base.OnEnable();
#if UNITY_EDITOR
if (!EditorApplication.isPlayingOrWillChangePlaymode)
{
Debug.Log("실행 중 아님");
return;
}
#endif
var maxLiquidAmount = FindAnyObjectByType<LiquidController>().GetMaxLiquidCount();
foreach (var element in _datas.Values)
{
element.ValidIngredients = element.GetValidIngredients(maxLiquidAmount);
}
}
}
}

View File

@ -14,8 +14,6 @@ namespace BlueWater.Items
protected virtual void OnEnable()
{
if (!Application.isPlaying) return;
InitializeDictionary();
}