Compare commits
No commits in common. "c0e6264355a492be0bb4d37f2ba4f1aece965b40" and "e68e7292286696a7ec5276f908e08af0b793fc30" have entirely different histories.
c0e6264355
...
e68e729228
@ -16,6 +16,10 @@ public class DungeonLogic : MonoBehaviour
|
||||
private PlayerController _player;
|
||||
private EnemyController _enemy;
|
||||
|
||||
// 던전 결과 이벤트
|
||||
public event Action OnDungeonSuccess;
|
||||
public event Action OnDungeonFailure;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
SpawnBossForCurrentStage();
|
||||
|
@ -50,7 +50,6 @@ public class PlayerStats : MonoBehaviour
|
||||
private SpeechBubbleFollower _speechBubbleFollower;
|
||||
private bool _isActiveBubble;
|
||||
private bool _hasShownBubbleToday; // 하루에 말풍선 하나만 표시하기
|
||||
private InteractionAnimationPanelController _interactionAnimation; // 상호작용 패널 Active 여부 확인
|
||||
|
||||
private int _mealCount;
|
||||
public int MealCount => _mealCount;
|
||||
@ -144,6 +143,7 @@ public class PlayerStats : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private InteractionAnimationPanelController _interactionAnimation;
|
||||
public void SetInteractionPanelController(InteractionAnimationPanelController panelController)
|
||||
{
|
||||
_interactionAnimation = panelController;
|
||||
@ -151,7 +151,7 @@ public class PlayerStats : MonoBehaviour
|
||||
|
||||
public void ShowBubble()
|
||||
{
|
||||
if (_interactionAnimation != null && _interactionAnimation.IsPanelActive()) return;
|
||||
if (_interactionAnimation.IsPanelActive()) return;
|
||||
|
||||
if(_isActiveBubble)
|
||||
_speechBubbleFollower.ShowMessage();
|
||||
@ -296,6 +296,11 @@ public class PlayerStats : MonoBehaviour
|
||||
// 하루가 실제로 종료된 경우에만 이벤트 발생
|
||||
if (isDayEnded)
|
||||
{
|
||||
// 결근 관련 변수 초기화
|
||||
_hasWorkedToday = false;
|
||||
_hasCheckedAbsenceToday = false;
|
||||
_hasShownBubbleToday = false;
|
||||
|
||||
// 식사 횟수 초기화
|
||||
_mealCount = 0;
|
||||
|
||||
@ -329,13 +334,6 @@ public class PlayerStats : MonoBehaviour
|
||||
EndDay(time, actionType);
|
||||
}
|
||||
|
||||
if (TimeStat >= 8.0f && TimeStat < 9.0f)
|
||||
{
|
||||
_hasWorkedToday = false;
|
||||
_hasCheckedAbsenceToday = false;
|
||||
_hasShownBubbleToday = false;
|
||||
}
|
||||
|
||||
CheckBubble();
|
||||
}
|
||||
|
||||
|
@ -35,9 +35,8 @@ public enum GamePhase // 단계별로 출력되는 대화가 달라짐
|
||||
{
|
||||
Intro, // 인트로 설명문
|
||||
Gameplay, // 게임 진행 팁? 등
|
||||
End, // 회고 엔딩
|
||||
ZeroEnd, // 평판 0 엔딩
|
||||
FailEnd // 같은 스테이지 3회 실패 엔딩
|
||||
End, // 엔딩 대화
|
||||
ZeroEnd
|
||||
}
|
||||
|
||||
public class ChatWindowController : MonoBehaviour, IPointerClickHandler
|
||||
|
@ -91,10 +91,6 @@ public class FairyDialogueManager
|
||||
{
|
||||
StartPhaseDialogue("zero");
|
||||
}
|
||||
else if (phase == GamePhase.FailEnd)
|
||||
{
|
||||
StartPhaseDialogue("fail");
|
||||
}
|
||||
}
|
||||
|
||||
// 단계별 시작 대화 찾기 및 시작
|
||||
|
@ -14,9 +14,6 @@ public partial class GameManager : Singleton<GameManager>
|
||||
private int stageLevel = 1; // 스테이지 정보
|
||||
public int StageLevel => stageLevel;
|
||||
|
||||
private int tryStageCount = 0;
|
||||
public int TryStageCount => tryStageCount;
|
||||
|
||||
// 날짜 변경 이벤트, 추후에 UI 상의 날짜를 변경할 때 사용
|
||||
public event Action<int> OnDayChanged;
|
||||
|
||||
@ -43,20 +40,17 @@ public partial class GameManager : Singleton<GameManager>
|
||||
|
||||
public void StartNPCDialogue(GamePhase phase) // intro, gameplay, end 존재
|
||||
{
|
||||
StartCoroutine(StartNPCDialogueCoroutine(phase));
|
||||
}
|
||||
|
||||
private IEnumerator StartNPCDialogueCoroutine(GamePhase phase)
|
||||
{
|
||||
if (chatWindowController == null)
|
||||
{
|
||||
yield return new WaitForSeconds(0.5f); // 씬 전환 대기
|
||||
chatWindowController = FindObjectOfType<ChatWindowController>();
|
||||
}
|
||||
if(chatWindowController == null)
|
||||
SetChatWindowController();
|
||||
|
||||
chatWindowController.SetGamePhase(phase);
|
||||
}
|
||||
|
||||
private void SetChatWindowController()
|
||||
{
|
||||
chatWindowController = FindObjectOfType<ChatWindowController>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
//일시 정지
|
||||
@ -85,7 +79,6 @@ public partial class GameManager : Singleton<GameManager>
|
||||
|
||||
public void ChangeToGameScene()
|
||||
{
|
||||
tryStageCount++; // 던전 시도 횟수 증가
|
||||
SceneManager.LoadScene("ReDungeon"); // 던전 Scene
|
||||
HandleSceneAudio("Dungeon");
|
||||
}
|
||||
@ -94,8 +87,6 @@ public partial class GameManager : Singleton<GameManager>
|
||||
{
|
||||
SceneManager.LoadScene("ReHousing"); // Home Scene
|
||||
HandleSceneAudio("Housing");
|
||||
|
||||
if (tryStageCount >= 3) FailEnd(); // 엔딩
|
||||
}
|
||||
|
||||
// TODO: Open Setting Panel 등 Panel 처리
|
||||
|
@ -16,24 +16,51 @@ public partial class GameManager
|
||||
|
||||
public void ClearStage()
|
||||
{
|
||||
tryStageCount = 0; // 시도 횟수 초기화
|
||||
stageLevel++;
|
||||
}
|
||||
|
||||
private void ZeroReputationEnd() // 평판 0 엔딩
|
||||
private void ZeroReputationEnd()
|
||||
{
|
||||
// npc와의 대화 출력, Phase = zero
|
||||
StartNPCDialogue(GamePhase.ZeroEnd);
|
||||
}
|
||||
|
||||
private void FailEnd() // 같은 스테이지 3회 도전 실패 엔딩
|
||||
{
|
||||
StartNPCDialogue(GamePhase.FailEnd);
|
||||
}
|
||||
|
||||
// 회고 엔딩. 7일차에 실행
|
||||
// 엔딩 관련 메서드. 7일차에 실행
|
||||
private void TriggerTimeEnding()
|
||||
{
|
||||
// npc와의 마지막 대화 출력
|
||||
StartNPCDialogue(GamePhase.End);
|
||||
|
||||
// 플레이어 상태에 따라 엔딩 판별
|
||||
// EndingType endingType = DetermineEnding();
|
||||
|
||||
// 엔딩 타입에 따라 다른 씬이나 UI 표시
|
||||
/*switch (endingType)
|
||||
{
|
||||
case EndingType.Normal:
|
||||
Debug.Log("던전 공략 성공");
|
||||
// TODO: 엔딩 관련 패널 띄우기
|
||||
break;
|
||||
case EndingType.Bad:
|
||||
Debug.Log("던전 공략 실패");
|
||||
|
||||
break;
|
||||
case EndingType.Happy:
|
||||
Debug.Log("던전 공략 성공과 훌륭한 평판 작");
|
||||
|
||||
break;
|
||||
}*/
|
||||
}
|
||||
|
||||
// 던전 스테이지와 평판 수치로 엔딩 판별
|
||||
private EndingType DetermineEnding()
|
||||
{
|
||||
if (stageLevel < GameConstants.maxStage) // 현재 스테이지 1 혹은 2
|
||||
return EndingType.Bad;
|
||||
|
||||
if (PlayerStats.Instance.ReputationStat >= happyEndReputation) // 평판이 일정 수치 이상
|
||||
return EndingType.Happy;
|
||||
|
||||
return EndingType.Normal;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user