Files
Colosseum/Assets/_Game/Scripts/Network/PlayerSpawnPoint.cs
dal4segno c265f980db chore: Assets 디렉토리 구조 정리 및 네이밍 컨벤션 적용
- Assets/_Game/ 하위로 게임 에셋 통합
- External/ 패키지 벤더별 분류 (Synty, Animations, UI)
- 에셋 네이밍 컨벤션 확립 및 적용
  (Data_Skill_, Data_SkillEffect_, Prefab_, Anim_, Model_, BT_ 등)
- pre-commit hook으로 네이밍 컨벤션 자동 검사 추가
- RESTRUCTURE_CHECKLIST.md 작성

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 19:08:27 +09:00

57 lines
1.8 KiB
C#

using UnityEngine;
namespace Colosseum.Network
{
/// <summary>
/// 플레이어 스폰 위치 마커
/// 씬에 배치하여 플레이어가 스폰될 위치를 지정
/// </summary>
public class PlayerSpawnPoint : MonoBehaviour
{
[Header("Spawn Settings")]
[SerializeField] private bool useRotation = true;
private static System.Collections.Generic.List<PlayerSpawnPoint> spawnPoints = new System.Collections.Generic.List<PlayerSpawnPoint>();
private void Awake()
{
spawnPoints.Add(this);
}
private void OnDestroy()
{
spawnPoints.Remove(this);
}
/// <summary>
/// 사용 가능한 스폰 포인트 중 하나를 반환
/// </summary>
public static Transform GetRandomSpawnPoint()
{
if (spawnPoints.Count == 0)
return null;
int index = Random.Range(0, spawnPoints.Count);
return spawnPoints[index].transform;
}
/// <summary>
/// 스폰 포인트 개수 반환
/// </summary>
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);
}
}
}