add difficultyDataClass

This commit is contained in:
kimura 2022-08-01 15:51:27 +09:00
parent 4f4607685d
commit 8be964e884
2 changed files with 29 additions and 0 deletions

View File

@ -67,6 +67,7 @@ public static class Const {
public static readonly string ShopCustomizeBonusDataSheet = "ShopCustomizeBonusData";
public static readonly string ScrollGamePlaceDataSheet = "ScrollGamePlaceData";
public static readonly string ScrollGameStageDataSheet = "ScrollGameStageData";
public static readonly string ScrollGameStageDifficultyDataSheet = "ScrollGameStageDifficultyData";
// language
public static readonly string LangJapanDataSheet = "LangJapanData";
@ -106,6 +107,7 @@ public static class Const {
new SheetData(Const.ShopCustomizeBonusDataSheet),
new SheetData(Const.ScrollGamePlaceDataSheet),
new SheetData(Const.ScrollGameStageDataSheet),
new SheetData(Const.ScrollGameStageDifficultyDataSheet),
};
public static readonly SheetData[] LanguageSheetNameList = new SheetData[]{
new SheetData(Const.LangJapanDataSheet, "LanguageData"),

View File

@ -573,4 +573,31 @@ public sealed class ScrollGameStageData
{
return RandomPrefabName.Select(x => Resources.Load<Transform>($"ScrollGame/Stages/Stage{x}")).ToArray();
}
}
[Serializable]
public sealed class ScrollGameStageDifficultyData
{
public int id;
public int placeId;
public int normalTime;
public int hardTime;
public int extraTime;
public ScrollGameDifficulty GetDifficultySwitchTime(float time)
{
if (time >= extraTime)
{
return ScrollGameDifficulty.Extra;
}
if (time >= hardTime)
{
return ScrollGameDifficulty.Hard;
}
if (time >= normalTime)
{
return ScrollGameDifficulty.Normal;
}
return ScrollGameDifficulty.Easy;
}
}