diff --git a/Assets/KJM/Scripts/Save/Save.cs b/Assets/KJM/Scripts/Save/Save.cs index a17dcde5..6cced79d 100644 --- a/Assets/KJM/Scripts/Save/Save.cs +++ b/Assets/KJM/Scripts/Save/Save.cs @@ -15,6 +15,9 @@ public class DungeonSave // 현재 진행 중인 스테이지 public int stageLevel = 0; + // 스테이지 도전 횟수 + public int tryStageCount = 999; + //병합을 위한 메서드 public void MergeWith(DungeonSave other) { @@ -26,6 +29,7 @@ public class DungeonSave if (other.moveSpeedLevel != 0) moveSpeedLevel = other.moveSpeedLevel; if (other.dashCoolDownLevel != 0) dashCoolDownLevel = other.dashCoolDownLevel; if (other.stageLevel != 0) stageLevel = other.stageLevel; + if (other.tryStageCount < 999) tryStageCount = other.tryStageCount; } } @@ -45,6 +49,16 @@ public class HomeSave //이벤트 public int mealCount = 999; + public bool hasShownBubbleToday = false; + public bool hasShownBubbleTodaySet = false; + + public bool hasCheckedAbsenceToday; + public bool hasCheckedAbsenceTodaySet = false; + + //튜토리얼 여부 + public bool hasTutorial; + public bool hasTutorialSet; + //병합을 위한 메서드 public void MergeWith(HomeSave other) { @@ -55,6 +69,12 @@ public class HomeSave if (other.health < 999) health = other.health; if (other.reputation < 999) reputation = other.reputation; if (other.mealCount < 999) mealCount = other.mealCount; + + if (other.hasShownBubbleTodaySet) hasShownBubbleToday = other.hasShownBubbleToday; + + if (other.hasCheckedAbsenceTodaySet) hasCheckedAbsenceToday = other.hasCheckedAbsenceToday; + + if (other.hasTutorialSet) hasTutorial = other.hasTutorial; } } @@ -65,6 +85,7 @@ public class Save public HomeSave homeSave; public DungeonSave dungeonSave; + //초기 값 반환 public Save InitSave() { return new Save @@ -75,7 +96,10 @@ public class Save time = 8.0f, health = 8.0f, reputation = 2.0f, - mealCount = 0 + mealCount = 0, + hasShownBubbleToday = false, + hasCheckedAbsenceToday = false, + hasTutorial = false }, dungeonSave = new DungeonSave { @@ -84,7 +108,8 @@ public class Save heartLevel = 1, moveSpeedLevel = 1, dashCoolDownLevel = 1, - stageLevel = 1 + stageLevel = 1, + tryStageCount = 0 } }; } diff --git a/Assets/KJM/Scripts/Save/SaveManager.cs b/Assets/KJM/Scripts/Save/SaveManager.cs index 29e35767..008aae54 100644 --- a/Assets/KJM/Scripts/Save/SaveManager.cs +++ b/Assets/KJM/Scripts/Save/SaveManager.cs @@ -46,9 +46,6 @@ public class SaveManager : Singleton backupSave = LoadBackup(); saveDataController.ApplySaveData(mainSave); - - Debug.Log("메인 로드" + mainSave.homeSave.reputation); //임시 코드 - Debug.Log("백업 로드" + backupSave.homeSave.reputation); //임시 코드 } private void UpdateSaveInfo() @@ -187,7 +184,7 @@ public class SaveManager : Singleton backupSave = fresh.InitSave(); SaveMain(); SaveBackup(); - saveDataController.ApplySaveData(fresh); + saveDataController.ApplySaveData(mainSave); } diff --git a/Assets/KJM/Scripts/Upgrade/UpgradeManager.cs b/Assets/KJM/Scripts/Upgrade/UpgradeManager.cs index db209224..bf2c2855 100644 --- a/Assets/KJM/Scripts/Upgrade/UpgradeManager.cs +++ b/Assets/KJM/Scripts/Upgrade/UpgradeManager.cs @@ -30,6 +30,8 @@ public class UpgradeManager : Singleton private RectTransform backgroundRectTransform; private List