シートデータに対応してレシピの非表示を切り替えられるようにした
This commit is contained in:
parent
4ef3a4648e
commit
9726536df0
|
|
@ -35,8 +35,12 @@ public class RecipeSelectDialog : MonoBehaviour
|
||||||
// レシピ一覧生成
|
// レシピ一覧生成
|
||||||
var content = scrollRect.content;
|
var content = scrollRect.content;
|
||||||
content.transform.DestroyAllChildrens();
|
content.transform.DestroyAllChildrens();
|
||||||
var data = SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet);
|
var productDataList = SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet);
|
||||||
foreach (var productData in data)
|
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);
|
var view = Instantiate(recipePrefab, content.transform);
|
||||||
view.SetRecipe(productData);
|
view.SetRecipe(productData);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue