ミッションカウンターリセットを追加・レシピ追加タイミングを変更

This commit is contained in:
kimura 2021-12-13 11:57:51 +09:00
parent f48cff7d69
commit a79d8b1884
3 changed files with 17 additions and 18 deletions

View File

@ -51,6 +51,9 @@ public class KitchenManager : MonoBehaviour
gameData.Material.Add(materialData);
}
materialData.Amount++;
// ミッションカウンターリセット
GameDataManager.GameData.ResetNormalTotalCount();
GameDataManager.GameData.ResetDailyTotalCount();
// 店舗レベル1達成表示
ShopLevelUp.ShowDialog(1, () =>

View File

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MyGame.Scenes.Main.Scripts;
using TMPro;
@ -28,10 +29,23 @@ public class ShopLevelUp : MonoBehaviour
shopLevel = LocalCacheManager.Load<int>(DataTag);
var scriptList = SpreadsheetDataManager.Instance.GetBaseDataList<BrotherScriptData>(Const.ScriptDataSheet);
var targetScriptList = scriptList.Where(data => data.id == shopLevel).ToList();
var productList = SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet);
var shopLevelList = SpreadsheetDataManager.Instance.GetBaseDataList<ShopLevelData>(Const.ShopLevelDataSheet);
var productData = productList.FirstOrDefault(data => data.shopLevel == shopLevel);
shopLevelText.text = shopLevel.ToString();
achievementText.text = shopLevelList.FirstOrDefault(data => data.shopLevel == shopLevel)?.achievement ?? "";
recipeNameText.text = productData?.name ?? "";
closeButton.OnClickAsObservable().Take(1).Subscribe(_ =>
{
GameDataManager.GameData.ViewedShopLevel = shopLevel;
GameDataManager.GameData.OrderConditionCount = 0;
// レシピ開放
if (productData != null)
{
GameDataManager.GameData.MyRecipes = new List<int>(GameDataManager.GameData.MyRecipes){productData.id}.Distinct().ToArray();
GameDataManager.GameData.DailyRecipeGetCount++;
}
GameDataManager.SaveGameData();
transform.SetLocalScale(0);
@ -55,12 +69,6 @@ public class ShopLevelUp : MonoBehaviour
});
}).AddTo(this);
var productList = SpreadsheetDataManager.Instance.GetBaseDataList<ProductData>(Const.ProductDataSheet);
var shopLevelList = SpreadsheetDataManager.Instance.GetBaseDataList<ShopLevelData>(Const.ShopLevelDataSheet);
shopLevelText.text = shopLevel.ToString();
achievementText.text = shopLevelList.FirstOrDefault(data => data.shopLevel == shopLevel)?.achievement ?? "";
recipeNameText.text = productList.FirstOrDefault(data => data.shopLevel == shopLevel)?.name ?? "";
summaryObject.SetActive(false);
this.CallWaitForSeconds(1f, () =>
{

View File

@ -45,19 +45,7 @@ public class RecipeSelectDialog : MonoBehaviour
var view = Instantiate(recipePrefab, content.transform);
view.SetRecipe(productData);
// 所持レシピ確認
var hasRecipe = false;
if (gameData.MyRecipes.Contains(productData.id))
{
hasRecipe = true;
}
else if (productData.shopLevel <= gameData.ViewedShopLevel)
{
// レシピ開放
gameData.MyRecipes = new List<int>(gameData.MyRecipes){productData.id}.ToArray();
gameData.DailyRecipeGetCount++;
hasRecipe = true;
}
if (hasRecipe)
{
view.SetLockPanel(false);
view.RecipeClickObservable.ThrottleFirst(TimeSpan.FromSeconds(.3f)).Subscribe(_ =>