DEG-181 [Fix] 자잘한 버그 수정

This commit is contained in:
Sehyeon 2025-05-15 15:57:54 +09:00
parent e7da3fb9fb
commit 4d0167f45b
14 changed files with 34 additions and 50 deletions

Binary file not shown.

BIN
Assets/Scenes/Main.unity (Stored with Git LFS)

Binary file not shown.

View File

@ -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<PlayerController>();
if (playerController != null)
{

View File

@ -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<PlayerController>();
if (playerController != null)
{

View File

@ -8,7 +8,6 @@ public class EnemyStateIdle: IEnemyState
public void Enter(EnemyController enemyController)
{
_enemyController = enemyController;
Debug.Log("## Idle 상태 진입");
_enemyController.SetAnimation(EnemyController.Idle, true);
}

View File

@ -11,7 +11,6 @@ public class EnemyStateTrace : IEnemyState
public void Enter(EnemyController enemyController)
{
_enemyController = enemyController;
Debug.Log("## Trace 상태 진입");
_detectPlayerTransform = _enemyController.TraceTargetTransform;
if (!_detectPlayerTransform)
{

View File

@ -127,6 +127,7 @@ public partial class GameManager : Singleton<GameManager>,ISaveable
if (gotoBed)
{
Debug.Log("탈진 이벤트 출력");
var panel = PlayerStats.Instance.GetInteractionPanelController();
if (panel != null)

View File

@ -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);

View File

@ -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);

View File

@ -95,7 +95,7 @@ public class PlayerStats : MonoBehaviour,ISaveable
var panel = FindObjectOfType<InteractionAnimationPanelController>();
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);
}
@ -419,7 +419,7 @@ public class PlayerStats : MonoBehaviour,ISaveable
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,
}
};
}

View File

@ -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) },

View File

@ -16,13 +16,6 @@ public enum LoadingState
Dungeon,
Sleep
}
//집안일 목록
public enum HouseworkState
{
Laundry,
Cleaning,
}
public class InteractionPanelController : MonoBehaviour
{

View File

@ -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()

View File

@ -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;
}
}