블랙잭 끝
This commit is contained in:
@@ -2,28 +2,38 @@
|
||||
|
||||
public class RoomClearGateController : MonoBehaviour
|
||||
{
|
||||
[Header("<EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ")]
|
||||
[Header("룸 클리어 후 열릴 게이트")]
|
||||
[SerializeField] private RoomExitGate exitGate;
|
||||
|
||||
[Header("Option")]
|
||||
[SerializeField] private bool requireRoomClearedBeforeOpen = true;
|
||||
|
||||
private bool isRoomCleared = false;
|
||||
private bool gateOpened = false;
|
||||
private string selectedSceneCode = "";
|
||||
|
||||
public bool IsRoomCleared => isRoomCleared;
|
||||
public string SelectedSceneCode => selectedSceneCode;
|
||||
public bool HasSelectedScene => !string.IsNullOrEmpty(selectedSceneCode);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>¸<EFBFBD> <20><> ȣ<><C8A3>
|
||||
// <20><> <20>Լ<EFBFBD><D4BC><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20>ٷ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʰ<EFBFBD>, "<22><> Ŭ<><C5AC><EFBFBD><EFBFBD> <20>Ϸ<EFBFBD>" <20><><EFBFBD>¸<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
public void MarkRoomCleared()
|
||||
{
|
||||
isRoomCleared = true;
|
||||
Debug.Log("<EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD><EFBFBD> <20>Ϸ<EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EEB0A1> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.");
|
||||
Debug.Log("방 클리어 완료. 이제 선택지에서 다음 방을 고를 수 있습니다.");
|
||||
}
|
||||
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EEB0AC> <20><> ȣ<><C8A3>
|
||||
// 기존 트리거가 이걸 호출해도, 선택 전이면 문 안 열리게 막음
|
||||
public void OpenClearGate()
|
||||
{
|
||||
if (!isRoomCleared)
|
||||
if (requireRoomClearedBeforeOpen && !isRoomCleared)
|
||||
{
|
||||
Debug.Log("<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> Ŭ<><C5AC><EFBFBD><EFBFBD> <20><><EFBFBD>̶<EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.");
|
||||
Debug.Log("아직 방 클리어 전이라 게이트를 열 수 없습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!HasSelectedScene)
|
||||
{
|
||||
Debug.Log("아직 다음 방을 선택하지 않아서 게이트를 열지 않습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -37,23 +47,31 @@ public void OpenClearGate()
|
||||
if (exitGate != null)
|
||||
{
|
||||
exitGate.OpenGate();
|
||||
Debug.Log("<EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>");
|
||||
Debug.Log("클리어 게이트 열림. 선택된 다음 씬: " + selectedSceneCode);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("Exit Gate<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʾҽ<CABE><D2BD>ϴ<EFBFBD>.");
|
||||
Debug.LogWarning("Exit Gate가 연결되지 않았습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetClearState()
|
||||
{
|
||||
isRoomCleared = false;
|
||||
gateOpened = false;
|
||||
}
|
||||
|
||||
public void OpenDoor(string code)
|
||||
{
|
||||
Debug.Log($"다음씬코드 : {code}");
|
||||
}
|
||||
selectedSceneCode = code;
|
||||
|
||||
Debug.Log("선택된 다음 씬 코드: " + selectedSceneCode);
|
||||
|
||||
if (exitGate != null)
|
||||
{
|
||||
exitGate.SetNextSceneName(selectedSceneCode);
|
||||
}
|
||||
|
||||
OpenClearGate();
|
||||
}
|
||||
public void ResetClearState()
|
||||
{
|
||||
isRoomCleared = false;
|
||||
gateOpened = false;
|
||||
selectedSceneCode = "";
|
||||
}
|
||||
}
|
||||
@@ -34,10 +34,13 @@ public class RoomExitGate : MonoBehaviour
|
||||
[SerializeField] private string playerTag = "Player";
|
||||
|
||||
[Header("Scene Move")]
|
||||
[SerializeField] private bool useRandomScene = true;
|
||||
[SerializeField] private bool useRandomScene = false;
|
||||
[SerializeField] private string fallbackSceneName;
|
||||
[SerializeField] private float sceneMoveDelay = 0.2f;
|
||||
|
||||
[Header("Selected Scene")]
|
||||
[SerializeField] private string selectedSceneName;
|
||||
|
||||
[Header("Start Setting")]
|
||||
[SerializeField] private bool hideGateOnStart = true;
|
||||
[SerializeField] private bool hidePortalOnStart = true;
|
||||
@@ -114,6 +117,12 @@ private void PrepareStartState()
|
||||
}
|
||||
}
|
||||
|
||||
public void SetNextSceneName(string sceneName)
|
||||
{
|
||||
selectedSceneName = sceneName;
|
||||
Debug.Log("게이트 다음 씬 설정: " + selectedSceneName);
|
||||
}
|
||||
|
||||
public void OpenGate()
|
||||
{
|
||||
if (isOpened || isOpening)
|
||||
@@ -277,6 +286,11 @@ private IEnumerator EnterGateRoutine()
|
||||
|
||||
private string GetNextSceneName()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(selectedSceneName))
|
||||
{
|
||||
return selectedSceneName;
|
||||
}
|
||||
|
||||
if (useRandomScene && RandomSceneRouteManager.Instance != null)
|
||||
{
|
||||
return RandomSceneRouteManager.Instance.GetNextSceneName();
|
||||
@@ -322,5 +336,7 @@ public void CloseGateImmediately()
|
||||
{
|
||||
gateVisualRoot.SetActive(false);
|
||||
}
|
||||
|
||||
selectedSceneName = "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user