マーケット初回表示対応
This commit is contained in:
parent
1da46055c4
commit
56d656ed41
|
@ -60,7 +60,19 @@ public class MarketManager : MonoBehaviour
|
||||||
var cityData = cityDataList.First(data => data.id == GameDataManager.GameData.CurrentCityId);
|
var cityData = cityDataList.First(data => data.id == GameDataManager.GameData.CurrentCityId);
|
||||||
marketBgTarget.DestroyAllChildrens();
|
marketBgTarget.DestroyAllChildrens();
|
||||||
Instantiate(cityData.GetMarketBgPrefab(), marketBgTarget);
|
Instantiate(cityData.GetMarketBgPrefab(), marketBgTarget);
|
||||||
|
|
||||||
|
// 初回都市来訪スクリプト
|
||||||
|
var scriptList = SpreadsheetDataManager.Instance.GetBaseDataList<BrotherScriptData>(Const.ScriptDataSheet);
|
||||||
|
if (UnityEngine.SceneManagement.SceneManager.sceneCount != 1) return;
|
||||||
|
// シナリオ読み込み
|
||||||
|
if (ItemConditionUtils.GetScriptList(GameDataManager.GameData.CurrentCityId, ItemCondition.FirstVisitCityMarket, true).FirstOrDefault() is not { } conditionData) return;
|
||||||
|
var scripts = scriptList.Where(data => data.id == conditionData.scriptId).ToList();
|
||||||
|
if (scripts.Count <= 0) return;
|
||||||
|
BrotherConversation.ShowDialog(scripts, () =>
|
||||||
|
{
|
||||||
|
// 既読処理
|
||||||
|
ItemConditionUtils.Use(conditionData);
|
||||||
|
});
|
||||||
|
|
||||||
// 最新の都市ではない場合、バイトが有効
|
// 最新の都市ではない場合、バイトが有効
|
||||||
if (!market.IsLatestCity)
|
if (!market.IsLatestCity)
|
||||||
|
|
|
@ -55,20 +55,24 @@ namespace MyGame.Scripts
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ScriptConditionData> GetScriptList(int cityId, ItemCondition condition)
|
public static List<ScriptConditionData> GetScriptList(int cityId, ItemCondition condition, bool ignoreUsed = false)
|
||||||
{
|
{
|
||||||
|
var ignoreList = ignoreUsed ? GameDataManager.GameData.UsedScriptCondition : new List<int>();
|
||||||
return SpreadsheetDataManager.Instance.GetBaseDataList<ScriptConditionData>(Const.ScriptConditionDataSheet)
|
return SpreadsheetDataManager.Instance.GetBaseDataList<ScriptConditionData>(Const.ScriptConditionDataSheet)
|
||||||
.Where(data => data.cityId == cityId)
|
.Where(data => data.cityId == cityId)
|
||||||
.Where(data => data.Condition == condition)
|
.Where(data => data.Condition == condition)
|
||||||
|
.Where(data => !ignoreList.Contains(data.id) )
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ScriptConditionData> GetScriptList(int cityId, ItemCondition condition, int value)
|
public static List<ScriptConditionData> GetScriptList(int cityId, ItemCondition condition, int value, bool ignoreUsed = false)
|
||||||
{
|
{
|
||||||
|
var ignoreList = ignoreUsed ? GameDataManager.GameData.UsedScriptCondition : new List<int>();
|
||||||
return SpreadsheetDataManager.Instance.GetBaseDataList<ScriptConditionData>(Const.ScriptConditionDataSheet)
|
return SpreadsheetDataManager.Instance.GetBaseDataList<ScriptConditionData>(Const.ScriptConditionDataSheet)
|
||||||
.Where(data => data.cityId == cityId)
|
.Where(data => data.cityId == cityId)
|
||||||
.Where(data => data.Condition == condition)
|
.Where(data => data.Condition == condition)
|
||||||
.Where(data => data.needValue <= value)
|
.Where(data => data.needValue <= value)
|
||||||
|
.Where(data => !ignoreList.Contains(data.id) )
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -188,6 +188,7 @@ public enum ItemCondition
|
||||||
CityLevel = 3,
|
CityLevel = 3,
|
||||||
CityUnlock = 4,
|
CityUnlock = 4,
|
||||||
CityFundingCompleted = 5,
|
CityFundingCompleted = 5,
|
||||||
|
FirstVisitCityMarket = 6,
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum RewardActionType
|
public enum RewardActionType
|
||||||
|
|
Loading…
Reference in New Issue