블록 조준 시스템 제작

및 기본 에디터 자동 호스트화
This commit is contained in:
2026-01-17 14:32:05 +09:00
parent b6822691b6
commit 11b9112739
36 changed files with 2644 additions and 36 deletions

View File

@@ -0,0 +1,26 @@
using UnityEngine;
using Unity.Netcode;
public class AutoHost : MonoBehaviour
{
// 에디터에서만 작동하도록 설정
void Start()
{
#if UNITY_EDITOR
// 1. NetworkManager가 씬에 존재하는지 확인
if (NetworkManager.Singleton != null)
{
// 2. 이미 서버나 클라이언트가 실행 중이 아닐 때만 실행
if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsClient)
{
NetworkManager.Singleton.StartHost();
Debug.Log("<color=yellow><b>[AutoHost]</b> 에디터 전용 호스트 자동 시작됨</color>");
}
}
else
{
Debug.LogError("[AutoHost] NetworkManager를 찾을 수 없습니다!");
}
#endif
}
}