解放済みレシピをMyRecipeに保存

This commit is contained in:
kimura 2021-10-01 12:22:41 +09:00
parent a3c04c97d6
commit 28f4dc8772
1 changed files with 12 additions and 1 deletions

View File

@ -28,7 +28,18 @@ public class RecipeSelectDialog : MonoBehaviour
var view = Instantiate(recipePrefab, content.transform);
view.SetRecipe(productData);
// 所持レシピ確認
if (gameData.MyRecipes.Contains(productData.id) || productData.shopLevel <= HeartMeter.Instance.ShopLevel.Value)
var hasRecipe = false;
if (gameData.MyRecipes.Contains(productData.id))
{
hasRecipe = true;
}
else if (productData.shopLevel <= HeartMeter.Instance.ShopLevel.Value)
{
// レシピ開放
gameData.MyRecipes = new List<int>(gameData.MyRecipes){productData.id}.ToArray();
hasRecipe = true;
}
if (hasRecipe)
{
view.SetLockPanel(false);
view.RecipeClickObservable.Subscribe(_ =>