店舗レベルでの会話表示を修正
This commit is contained in:
parent
f96c59fc2f
commit
e77e78ad1a
|
@ -76,17 +76,17 @@ public class HeaderManager : MonoBehaviour
|
|||
|
||||
// 都市ごとの店舗レベルアップチェック
|
||||
var cityShopLevelDataList = SpreadsheetDataManager.Instance.GetBaseDataList<CityShopLevelData>(Const.CityShopLevelDataSheet);
|
||||
var currentCityList = cityShopLevelDataList.Where(data => data.cityId == GameDataManager.GameData.CurrentCityId);
|
||||
var currentCityLevelList = cityShopLevelDataList.Where(data => data.cityId == GameDataManager.GameData.CurrentCityId);
|
||||
GameDataObserver.Instance.HeartObserver.Subscribe(_ =>
|
||||
{
|
||||
if (UnityEngine.SceneManagement.SceneManager.sceneCount != 1) return;
|
||||
if (currentCityList.LastOrDefault(data => data.shopLevel == cityGameData.ViewedShopLevel + 1) is not { } newShopLevelData) return;
|
||||
if (currentCityLevelList.FirstOrDefault(data => data.shopLevel == cityGameData.ViewedShopLevel + 1) is not { } newShopLevelData) return;
|
||||
if (newShopLevelData.heart > cityGameData.Heart) return;
|
||||
// レベルアップ処理
|
||||
cityGameData.ViewedShopLevel = newShopLevelData.shopLevel;
|
||||
GameDataManager.SaveGameData();
|
||||
// シナリオ読み込み
|
||||
if (ItemConditionUtils.GetScriptList(newShopLevelData.cityId, ItemCondition.CityLevel).FirstOrDefault() is not { } conditionData) return;
|
||||
if (ItemConditionUtils.GetScriptList(newShopLevelData.cityId, ItemCondition.CityLevel, cityGameData.ViewedShopLevel).FirstOrDefault() is not { } conditionData) return;
|
||||
var levelUpScripts = scriptList.Where(data => data.id == conditionData.scriptId).ToList();
|
||||
if (levelUpScripts.Count <= 0) return;
|
||||
BrotherConversation.ShowDialog(levelUpScripts, () =>
|
||||
|
|
Loading…
Reference in New Issue