using UnityEngine; public class RoomClearGateController : MonoBehaviour { [Header("�� Ŭ���� �� ���� ����Ʈ")] [SerializeField] private RoomExitGate exitGate; private bool isRoomCleared = false; private bool gateOpened = false; public bool IsRoomCleared => isRoomCleared; // ������ ���� �¸� �� ȣ�� // �� �Լ��� ����Ʈ�� �ٷ� ���� �ʰ�, "�� Ŭ���� �Ϸ�" ���¸� ������ public void MarkRoomCleared() { isRoomCleared = true; Debug.Log("�� Ŭ���� �Ϸ�. ���� �������� ���� ����Ʈ�� �����ϴ�."); } // �������� ���� �� ȣ�� public void OpenClearGate() { if (!isRoomCleared) { Debug.Log("���� �� Ŭ���� ���̶� ����Ʈ�� �� �� �����ϴ�."); return; } if (gateOpened) { return; } gateOpened = true; if (exitGate != null) { exitGate.OpenGate(); Debug.Log("�� Ŭ���� ����Ʈ ����"); } else { Debug.LogWarning("Exit Gate�� ������� �ʾҽ��ϴ�."); } } public void ResetClearState() { isRoomCleared = false; gateOpened = false; } public void OpenDoor(string code) { Debug.Log($"다음씬코드 : {code}"); } }