46 lines
1.0 KiB
C#
46 lines
1.0 KiB
C#
using UnityEngine;
|
|
using Unity.Netcode;
|
|
|
|
namespace Colosseum.Network
|
|
{
|
|
/// <summary>
|
|
/// 네트워크 연결 관리 (Host/Client 시작)
|
|
/// </summary>
|
|
public class NetworkLauncher : MonoBehaviour
|
|
{
|
|
[Header("UI References")]
|
|
[SerializeField] private GameObject connectionUI;
|
|
|
|
private void Start()
|
|
{
|
|
// 게임 시작 시 UI 표시
|
|
if (connectionUI != null)
|
|
connectionUI.SetActive(true);
|
|
}
|
|
|
|
public void StartHost()
|
|
{
|
|
NetworkManager.Singleton.StartHost();
|
|
HideConnectionUI();
|
|
}
|
|
|
|
public void StartClient()
|
|
{
|
|
NetworkManager.Singleton.StartClient();
|
|
HideConnectionUI();
|
|
}
|
|
|
|
public void StartServer()
|
|
{
|
|
NetworkManager.Singleton.StartServer();
|
|
HideConnectionUI();
|
|
}
|
|
|
|
private void HideConnectionUI()
|
|
{
|
|
if (connectionUI != null)
|
|
connectionUI.SetActive(false);
|
|
}
|
|
}
|
|
}
|