From 62ab81bba29db97f54ed9132c81e4e35ed50b23c Mon Sep 17 00:00:00 2001 From: 99jamin <99jamin56@gmail.com> Date: Wed, 14 May 2025 18:09:05 +0900 Subject: [PATCH] =?UTF-8?q?DEG-165=20[Fix]=20=EC=84=B8=EC=9D=B4=EB=B8=8C?= =?UTF-8?q?=20=EB=A7=A4=EB=8B=88=EC=A0=80,=20=EC=97=85=EA=B7=B8=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=EB=93=9C=20=EB=A7=A4=EB=8B=88=EC=A0=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/KJM/Scripts/Save/Save.cs | 29 +++++++++++++-- Assets/KJM/Scripts/Save/SaveManager.cs | 5 +-- Assets/KJM/Scripts/Upgrade/UpgradeManager.cs | 38 ++++++++++++++++++-- Assets/KJM/Scripts/Upgrade/UpgradeStat.cs | 1 - 4 files changed, 64 insertions(+), 9 deletions(-) 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