diff --git a/Assets/JAY/Scripts/PlayerController.cs b/Assets/JAY/Scripts/PlayerController.cs index 7c2e1c34..279ba700 100644 --- a/Assets/JAY/Scripts/PlayerController.cs +++ b/Assets/JAY/Scripts/PlayerController.cs @@ -5,6 +5,7 @@ using System.Runtime.CompilerServices; using UnityEditor.TextCore.Text; using UnityEngine; using UnityEngine.SceneManagement; +using UnityEngine.UI; public enum PlayerState { None, Idle, Move, Win, Hit, Dead } @@ -17,6 +18,7 @@ public class PlayerController : CharacterBase, IObserver [SerializeField] private GameObject normalModel; // char_body : 일상복 [SerializeField] private GameObject battleModel; // warrior_1 : 전투복 [SerializeField] private Transform dashEffectAnchor; // 대시 이펙트 위치 + [SerializeField] private Image dashCooldownFillImage; //대시 쿨다운 이미지 // 내부에서만 사용하는 변수 private PlayerHitEffectController hitEffectController; @@ -108,7 +110,16 @@ public class PlayerController : CharacterBase, IObserver //대시 쿨타임 진행 if (dashCooldownTimer > 0f) + { dashCooldownTimer -= Time.deltaTime; + if(dashCooldownFillImage != null) + dashCooldownFillImage.fillAmount = DashCooldownRatio; + } + else + { + if(dashCooldownFillImage != null) + dashCooldownFillImage.fillAmount = 0f; + } // Hit 상태거나 게임 끝났을 땐 땐 입력 무시 if (CurrentState == PlayerState.Hit || CurrentState == PlayerState.Dead || CurrentState == PlayerState.Win) diff --git a/Assets/KJM/KJM_Test/Save/Save.cs b/Assets/KJM/KJM_Test/Save/Save.cs index a17dcde5..d870d58a 100644 --- a/Assets/KJM/KJM_Test/Save/Save.cs +++ b/Assets/KJM/KJM_Test/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 = false; + public bool hasTutorialSet = false; + //병합을 위한 메서드 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/KJM_Test/Save/SaveManager.cs b/Assets/KJM/KJM_Test/Save/SaveManager.cs index 29e35767..008aae54 100644 --- a/Assets/KJM/KJM_Test/Save/SaveManager.cs +++ b/Assets/KJM/KJM_Test/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/KJM_Test/Upgrade/UpgradeManager.cs b/Assets/KJM/KJM_Test/Upgrade/UpgradeManager.cs index db209224..bf2c2855 100644 --- a/Assets/KJM/KJM_Test/Upgrade/UpgradeManager.cs +++ b/Assets/KJM/KJM_Test/Upgrade/UpgradeManager.cs @@ -30,6 +30,8 @@ public class UpgradeManager : Singleton private RectTransform backgroundRectTransform; private List