デバッグのレシピリセット修正

This commit is contained in:
kimura 2022-08-15 10:41:33 +09:00
parent 1f06eb5d68
commit cbeff6aeff
1 changed files with 9 additions and 6 deletions

View File

@ -98,7 +98,7 @@ public class DebugOptionManager : MonoBehaviour
// 所持素材
gameData.Material.Clear();
// レシピ
gameData.MyRecipes = GetMyRecipe(gameData.ViewedShopLevel);
gameData.MyRecipes = GetMyRecipe(gameData.ViewedShopLevel, true);
// フライパン
gameData.Pans = new[] { Const.DefaultPanId };
}).AddTo(this);
@ -369,12 +369,15 @@ public class DebugOptionManager : MonoBehaviour
}).AddTo(this);
}
private static int[] GetMyRecipe(int level)
private static int[] GetMyRecipe(int level, bool clearShopRecipe = false)
{
var shopLevelList = SpreadsheetDataManager.Instance.GetBaseDataList<ShopLevelData>(Const.ShopLevelDataSheet);
return GameDataManager.GameData.MyRecipes.Except(shopLevelList.Select(data => data.id))
.Union(shopLevelList.Where(data => data.shopLevel <= level).Select(data => data.id))
.ToArray();
var productList = SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet);
var levelUpAchievedList = productList.Where(data => data.shopLevel != Const.SpecialShopLevel).ToList();
var levelUpAchievedRecipeList = levelUpAchievedList.Where(data => data.shopLevel <= level).Select(data => data.id);
var shopRecipe = clearShopRecipe
? GameDataManager.GameData.MyRecipes.Except(levelUpAchievedList.Select(data => data.id))
: Array.Empty<int>();
return levelUpAchievedRecipeList.Union(shopRecipe).ToArray();
}
#endif
}