using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem; public class RoomRouteDebugTester : MonoBehaviour { private List currentChoices = new List(); private void Update() { if (RoomRouteManager.Instance == null) { return; } if (Keyboard.current == null) { return; } // CŰ: ¹æ¹® ¾È ÇÑ ¹æ Áß ·£´ý Èĺ¸ »Ì±â if (Keyboard.current.cKey.wasPressedThisFrame) { currentChoices = RoomRouteManager.Instance.GetRandomNextRooms(); Debug.Log($"ÇöÀç ¼±Åà °¡´ÉÇÑ Èĺ¸ °³¼ö: {currentChoices.Count}"); for (int i = 0; i < currentChoices.Count; i++) { Debug.Log($"{i + 1}¹ø ¼±ÅÃÁö ¡æ ¹æ ¹øÈ£: {currentChoices[i].roomNumber}, ¾À À̸§: {currentChoices[i].sceneName}"); } } // 1Ű: ù ¹øÂ° Èĺ¸ ¼±Åà if (Keyboard.current.digit1Key.wasPressedThisFrame) { MoveToChoice(0); } // 2Ű: µÎ ¹øÂ° Èĺ¸ ¼±Åà if (Keyboard.current.digit2Key.wasPressedThisFrame) { MoveToChoice(1); } // TŰ: ¹æ¹® »óÅ ȮÀÎ if (Keyboard.current.tKey.wasPressedThisFrame) { Debug.Log($"¹æ¹®ÇÑ ¹æ °³¼ö: {RoomRouteManager.Instance.VisitedRoomCount} / {RoomRouteManager.Instance.TotalRoomCount}"); Debug.Log($"ÇöÀç ¹æ ¹øÈ£: {RoomRouteManager.Instance.CurrentRoomNumber}"); } // XŰ: Å×½ºÆ®¿ë ¹æ¹® ±â·Ï ÃʱâÈ­ if (Keyboard.current.xKey.wasPressedThisFrame) { Debug.Log("¹æ¹® ±â·Ï ÃʱâÈ­"); currentChoices.Clear(); RoomRouteManager.Instance.ResetVisitedRooms(); } // FŰ: ¸ðµç ¹æ ¹æ¹® ÈÄ ¸¶Áö¸· ¾À À̵¿ Å×½ºÆ® if (Keyboard.current.fKey.wasPressedThisFrame) { Debug.Log("¸¶Áö¸· ¾À À̵¿ Å×½ºÆ®"); RoomRouteManager.Instance.MoveToFinalScene(); } } private void MoveToChoice(int index) { if (currentChoices == null || currentChoices.Count == 0) { Debug.LogWarning("¸ÕÀú C۸¦ ´­·¯ ·£´ý È常¦ »Ì¾Æ¾ß ÇÕ´Ï´Ù."); return; } if (index < 0 || index >= currentChoices.Count) { Debug.LogWarning("ÇØ´ç ¹øÈ£ÀÇ ¼±ÅÃÁö°¡ ¾ø½À´Ï´Ù."); return; } int targetRoomNumber = currentChoices[index].roomNumber; Debug.Log($"{index + 1}¹ø ¼±ÅÃÁö ¼±Åà ¡æ ¹æ {targetRoomNumber} À̵¿"); currentChoices.Clear(); RoomRouteManager.Instance.MoveToRoom(targetRoomNumber); } }