diff --git a/Assets/Prefabs/Scene/ReDungeon/Canvas.prefab b/Assets/Prefabs/Scene/ReDungeon/Canvas.prefab index 3c84062f..10e1a2bf 100644 --- a/Assets/Prefabs/Scene/ReDungeon/Canvas.prefab +++ b/Assets/Prefabs/Scene/ReDungeon/Canvas.prefab @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:12bfd1654ba68b913d147f76a0818707673a8656e504ed472a03aaecd4335813 -size 61886 +oid sha256:9e50591f3f01db29ccf3d7c5d25f0a4fb374c50de8ef9bef54c387c11ff65e9d +size 61326 diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 0b4275b0..7d996521 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:161c8428510aed3aee2016c628d15242085204db71c057ddd6d8e0e8fe4ec555 -size 144245 +oid sha256:e939625b285c19c5fc6e6dce9f32c638076372bdae632e458b7f316fda70a969 +size 144480 diff --git a/Assets/Scripts/Character/Enemy/BossPattern/AoeControllerBase.cs b/Assets/Scripts/Character/Enemy/BossPattern/AoeControllerBase.cs index 8717a99b..2348be90 100644 --- a/Assets/Scripts/Character/Enemy/BossPattern/AoeControllerBase.cs +++ b/Assets/Scripts/Character/Enemy/BossPattern/AoeControllerBase.cs @@ -96,9 +96,6 @@ public abstract class AoeControllerBase : MonoBehaviour { if (hit.CompareTag("Player")) { - Debug.Log($"{hit.name}에게 {_data.damage} 데미지 적용"); - // TODO: 실제 데미지 처리 로직 호출 - // 임시 데이미 처리 로직 PlayerController playerController = hit.transform.GetComponent(); if (playerController != null) { diff --git a/Assets/Scripts/Character/Enemy/BossPattern/VerticalAoeController.cs b/Assets/Scripts/Character/Enemy/BossPattern/VerticalAoeController.cs index 6df39dc6..65f9b160 100644 --- a/Assets/Scripts/Character/Enemy/BossPattern/VerticalAoeController.cs +++ b/Assets/Scripts/Character/Enemy/BossPattern/VerticalAoeController.cs @@ -34,9 +34,6 @@ public class VerticalAoeController : AoeControllerBase foreach (var hit in hits) { if (!hit.CompareTag("Player")) continue; - Debug.Log($"{hit.name} 사각형 범위에 있어 데미지 적용"); - // TODO: 데미지 로직 - // 임시 데이미 처리 로직 PlayerController playerController = hit.transform.GetComponent(); if (playerController != null) { diff --git a/Assets/Scripts/Character/Enemy/EnemyState/Commons/EnemyStateIdle.cs b/Assets/Scripts/Character/Enemy/EnemyState/Commons/EnemyStateIdle.cs index d23de9c8..66db8ba5 100644 --- a/Assets/Scripts/Character/Enemy/EnemyState/Commons/EnemyStateIdle.cs +++ b/Assets/Scripts/Character/Enemy/EnemyState/Commons/EnemyStateIdle.cs @@ -8,7 +8,6 @@ public class EnemyStateIdle: IEnemyState public void Enter(EnemyController enemyController) { _enemyController = enemyController; - Debug.Log("## Idle 상태 진입"); _enemyController.SetAnimation(EnemyController.Idle, true); } diff --git a/Assets/Scripts/Character/Enemy/EnemyState/Melee/EnemyStateTrace.cs b/Assets/Scripts/Character/Enemy/EnemyState/Melee/EnemyStateTrace.cs index ba2c7f76..a024cf17 100644 --- a/Assets/Scripts/Character/Enemy/EnemyState/Melee/EnemyStateTrace.cs +++ b/Assets/Scripts/Character/Enemy/EnemyState/Melee/EnemyStateTrace.cs @@ -11,7 +11,6 @@ public class EnemyStateTrace : IEnemyState public void Enter(EnemyController enemyController) { _enemyController = enemyController; - Debug.Log("## Trace 상태 진입"); _detectPlayerTransform = _enemyController.TraceTargetTransform; if (!_detectPlayerTransform) { diff --git a/Assets/Scripts/Common/GameManager.cs b/Assets/Scripts/Common/GameManager.cs index 806b17cd..c37dca20 100644 --- a/Assets/Scripts/Common/GameManager.cs +++ b/Assets/Scripts/Common/GameManager.cs @@ -127,6 +127,7 @@ public partial class GameManager : Singleton,ISaveable if (gotoBed) { + Debug.Log("탈진 이벤트 출력"); var panel = PlayerStats.Instance.GetInteractionPanelController(); if (panel != null) diff --git a/Assets/Scripts/System/DailyRoutine/InteractionController.cs b/Assets/Scripts/System/DailyRoutine/InteractionController.cs index 59f959e1..bca63943 100644 --- a/Assets/Scripts/System/DailyRoutine/InteractionController.cs +++ b/Assets/Scripts/System/DailyRoutine/InteractionController.cs @@ -144,6 +144,7 @@ public class InteractionController : MonoBehaviour if (!PlayerStats.Instance.CanPerformByHealth(ActionType.OvertimeWork)) { PlayerStats.Instance.ShowAndHideBubble("체력이 없어..."); + housingCanvasController.HideSuddenEventPanel(); // 판넬 종료 return; } PlayerStats.Instance.PerformAction(ActionType.OvertimeWork); diff --git a/Assets/Scripts/System/DungeonLogic.cs b/Assets/Scripts/System/DungeonLogic.cs index e7039fb5..ec8f3926 100644 --- a/Assets/Scripts/System/DungeonLogic.cs +++ b/Assets/Scripts/System/DungeonLogic.cs @@ -56,8 +56,6 @@ public class DungeonLogic : MonoBehaviour { if (isFailed || isCompleted) return; // 어느 한 쪽 사망시 더이상 피격 X - // TODO: 플레이어 피격 효과음 - var result = _dungeonPanelController.SetPlayerHealth(); if (!result) // 하트 모두 소모 { @@ -70,9 +68,6 @@ public class DungeonLogic : MonoBehaviour Debug.Log("enemyGETHIT"); if (isFailed || isCompleted) return; - - // TODO: 에너미 피격 효과음 - _dungeonPanelController.SetBossHealthBar(enemy.currentHP); } @@ -99,10 +94,8 @@ public class DungeonLogic : MonoBehaviour { if (!isCompleted && !isFailed) { - Debug.Log("던전 공략 성공~!"); GameManager.Instance.ClearStage(); // 스테이지 수 증가 isCompleted = true; - // OnDungeonSuccess?.Invoke(); _dungeonPanelController.SetBossHealthBar(0.0f); // 보스 체력 0 재설정 @@ -122,9 +115,7 @@ public class DungeonLogic : MonoBehaviour { if (!isCompleted && !isFailed) { - Debug.Log("던전 공략 실패~!"); isFailed = true; - // OnDungeonFailure?.Invoke(); _player.SetState(PlayerState.Dead); diff --git a/Assets/Scripts/System/PlayerStats.cs b/Assets/Scripts/System/PlayerStats.cs index abb605a7..e00151b6 100644 --- a/Assets/Scripts/System/PlayerStats.cs +++ b/Assets/Scripts/System/PlayerStats.cs @@ -95,7 +95,7 @@ public class PlayerStats : MonoBehaviour,ISaveable var panel = FindObjectOfType(); if (panel != null) { - PlayerStats.Instance.SetInteractionPanelController(panel); + SetInteractionPanelController(panel); } } @@ -104,6 +104,7 @@ public class PlayerStats : MonoBehaviour,ISaveable if (HealthStat > 0) return; Exhaustion?.Invoke(); // 탈진 이벤트 발생 + } public InteractionAnimationPanelController GetInteractionPanelController() @@ -115,9 +116,12 @@ public class PlayerStats : MonoBehaviour,ISaveable private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { - // 새 씬에서 메시지 패널 다시 로드 - LoadMessagePanel(); - CheckBubble(); + // 하우징 씬에서만 메시지 패널 다시 로드 + if (scene.name == "ReHousing") + { + LoadMessagePanel(); + CheckBubble(); + } } // OnDestroy에서 이벤트 구독 해제 @@ -386,12 +390,8 @@ public class PlayerStats : MonoBehaviour,ISaveable if (HealthStat <= 0) { HealthStat = 0.0f; - // 현재는 0 되자마자 발생하도록 처리하였는데 다른 방식으로의 처리가 필요하다면 말씀해주십시오. - // 동작 이후에 스탯을 깎는다는 기준하에 작성하였습니다. (동작 전에는 CanPerformByHealth()를 통해 행동 가능 여부 판단) - - // 탈진 이벤트 발생 - Debug.Log("탈진! 체력 0"); GameManager.Instance.gotoBed = true; + // 씬 이동 중 아니면 0.5초로 줄이기 4초 너무 길음;; Invoke(nameof(TriggerExhaustion), 4f); } @@ -415,11 +415,11 @@ public class PlayerStats : MonoBehaviour,ISaveable { ReputationStat = 0f; } - + if (ReputationStat <= 0) { ZeroReputation?.Invoke(); - ReputationStat = 0.0f; + ReputationStat = 0f; } if (ReputationStat > _gameConstants.maxReputation) @@ -434,6 +434,9 @@ public class PlayerStats : MonoBehaviour,ISaveable { if (save?.homeSave != null) { + // 확인용 Debug + // Debug.Log($"TimeStat {TimeStat}, HealthStat {HealthStat}, ReputationStat {ReputationStat}"); + TimeStat = Mathf.Clamp(save.homeSave.time, 0, _gameConstants.maxTime); HealthStat = Mathf.Clamp(save.homeSave.health, 0, _gameConstants.maxHealth); ReputationStat = Mathf.Clamp(save.homeSave.reputation, 0, _gameConstants.maxReputation); @@ -441,7 +444,9 @@ public class PlayerStats : MonoBehaviour,ISaveable _hasCheckedAbsenceToday = save.homeSave.hasCheckedAbsenceToday; _hasShownBubbleToday = save.homeSave.hasShownBubbleToday; - //UI적용 + // Debug.Log($"AfterSave TimeStat {TimeStat}, HealthStat {HealthStat}, ReputationStat {ReputationStat}"); + + //UI적용 <- UI가 스탯 변경될 때 적용되는 거랑 아래의 거랑 같이 이벤트가 발동해서 수치가 이상해집니다 OnStatsChanged?.Invoke(new StatsChangeData(TimeStat, HealthStat, ReputationStat)); } } @@ -452,16 +457,16 @@ public class PlayerStats : MonoBehaviour,ISaveable { homeSave = new HomeSave { - time = Mathf.Clamp(this.TimeStat,0,_gameConstants.maxTime), - health = Mathf.Clamp(this.HealthStat,0,_gameConstants.maxHealth), - reputation = Mathf.Clamp(this.ReputationStat,0,_gameConstants.maxReputation), - mealCount = Mathf.Clamp(this._mealCount,0,2), + time = Mathf.Clamp(TimeStat,0,_gameConstants.maxTime), + health = Mathf.Clamp(HealthStat,0,_gameConstants.maxHealth), + reputation = Mathf.Clamp(ReputationStat,0,_gameConstants.maxReputation), + mealCount = Mathf.Clamp(_mealCount,0,2), hasCheckedAbsenceTodaySet = true, - hasCheckedAbsenceToday = this._hasCheckedAbsenceToday, + hasCheckedAbsenceToday = _hasCheckedAbsenceToday, hasShownBubbleTodaySet = true, - hasShownBubbleToday = this._hasShownBubbleToday, + hasShownBubbleToday = _hasShownBubbleToday, } }; } diff --git a/Assets/Scripts/System/ValueByAction.cs b/Assets/Scripts/System/ValueByAction.cs index 7c62729f..88c53015 100644 --- a/Assets/Scripts/System/ValueByAction.cs +++ b/Assets/Scripts/System/ValueByAction.cs @@ -35,7 +35,7 @@ public class ValueByAction // 기본 액션들, 효과(시간, 체력, 평판 순) { ActionType.Sleep, new ActionEffect(_gameConstants.forcedValue, 0, 0) }, // 8시 강제 기상 { ActionType.OverSlept, new ActionEffect(_gameConstants.forcedValue, 0, 0) }, // 결근 (오후 3~6시 기상) - { ActionType.ForcedSleep, new ActionEffect(_gameConstants.forcedValue, 4, 0) }, // 탈진 + { ActionType.ForcedSleep, new ActionEffect(_gameConstants.forcedValue, 4, -3.0f) }, // 탈진 { ActionType.Eat, new ActionEffect(+1.0f, +1.0f, 0) }, { ActionType.Work, new ActionEffect(+10.0f, -3.0f, +0.2f) }, // 8to6: 10시간 { ActionType.Dungeon, new ActionEffect(+3.0f, -3.0f, 0) }, diff --git a/Assets/Scripts/UI/Panel Controller/InteractionPanelController.cs b/Assets/Scripts/UI/Panel Controller/InteractionPanelController.cs index 42736ae0..e41c5998 100644 --- a/Assets/Scripts/UI/Panel Controller/InteractionPanelController.cs +++ b/Assets/Scripts/UI/Panel Controller/InteractionPanelController.cs @@ -16,13 +16,6 @@ public enum LoadingState Dungeon, Sleep } -//집안일 목록 -public enum HouseworkState -{ - Laundry, - Cleaning, - -} public class InteractionPanelController : MonoBehaviour { diff --git a/Assets/Scripts/UI/Panel Controller/MainUIPanelController.cs b/Assets/Scripts/UI/Panel Controller/MainUIPanelController.cs index 05550301..f9bd64a1 100644 --- a/Assets/Scripts/UI/Panel Controller/MainUIPanelController.cs +++ b/Assets/Scripts/UI/Panel Controller/MainUIPanelController.cs @@ -8,8 +8,8 @@ public class MainUIPanelController : MonoBehaviour public void OnClickStartButton() { - // var isNewStart = PlayerPrefsManager.GetIsNewStart(); - GameManager.Instance.ChangeToHomeScene(true); // isNewStart + var isNewStart = PlayerPrefsManager.GetIsNewStart(); + GameManager.Instance.ChangeToHomeScene(isNewStart); } public void OnClickSettingsButton() diff --git a/Assets/Scripts/UI/SpeechBubbleFollower.cs b/Assets/Scripts/UI/SpeechBubbleFollower.cs index 761bced4..3e9be956 100644 --- a/Assets/Scripts/UI/SpeechBubbleFollower.cs +++ b/Assets/Scripts/UI/SpeechBubbleFollower.cs @@ -49,7 +49,8 @@ public class SpeechBubbleFollower : MonoBehaviour { if (playerTransform == null) { - playerTransform = GameObject.FindGameObjectWithTag("Player").transform; + if(GameObject.FindGameObjectWithTag("Player") != null) + playerTransform = GameObject.FindGameObjectWithTag("Player").transform; } }