シートデータに対応してレシピの非表示を切り替えられるようにした

This commit is contained in:
kimura 2021-11-15 14:50:04 +09:00
parent 4ef3a4648e
commit 9726536df0
1 changed files with 6 additions and 2 deletions

View File

@ -35,8 +35,12 @@ public class RecipeSelectDialog : MonoBehaviour
// レシピ一覧生成
var content = scrollRect.content;
content.transform.DestroyAllChildrens();
var data = SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet);
foreach (var productData in data)
var productDataList = SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet);
var shopData = SpreadsheetDataManager.Instance.GetBaseDataList<ShopData>(Const.ShopDataSheet);
var shopRecipes = shopData.Where(data => data.Category == ItemCategory.Recipe).Select(data => data.itemId);
var targetList = productDataList.Where(data => data.shopLevel != Const.SpecialShopLevel || shopRecipes.Contains(data.id)).ToList();
foreach (var productData in targetList)
{
var view = Instantiate(recipePrefab, content.transform);
view.SetRecipe(productData);