using UnityEngine; namespace Colosseum.Network { /// /// 플레이어 스폰 위치 마커 /// 씬에 배치하여 플레이어가 스폰될 위치를 지정 /// public class PlayerSpawnPoint : MonoBehaviour { [Header("Spawn Settings")] [SerializeField] private bool useRotation = true; private static System.Collections.Generic.List spawnPoints = new System.Collections.Generic.List(); private void Awake() { spawnPoints.Add(this); } private void OnDestroy() { spawnPoints.Remove(this); } /// /// 사용 가능한 스폰 포인트 중 하나를 반환 /// public static Transform GetRandomSpawnPoint() { if (spawnPoints.Count == 0) return null; int index = Random.Range(0, spawnPoints.Count); return spawnPoints[index].transform; } /// /// 스폰 포인트 개수 반환 /// public static int SpawnPointCount => spawnPoints.Count; private void OnDrawGizmos() { Gizmos.color = Color.green; Gizmos.DrawWireSphere(transform.position, 0.5f); Gizmos.color = Color.blue; Gizmos.DrawLine(transform.position, transform.position + transform.forward * 1.5f); // 화살표 머리 Vector3 arrowPos = transform.position + transform.forward * 1.5f; Gizmos.DrawLine(arrowPos, arrowPos - transform.forward * 0.3f + transform.right * 0.2f); Gizmos.DrawLine(arrowPos, arrowPos - transform.forward * 0.3f - transform.right * 0.2f); } } }