Vanya Orlov
Знаток
(456)
6 месяцев назад
using UnityEngine;
using Mirror;
public class GameManager : MonoBehaviour
{
public void StopGame()
{
if (NetworkServer.active && NetworkClient.isConnected)
{
NetworkManager.singleton.StopHost();
}
else if (NetworkClient.isConnected)
{
NetworkManager.singleton.StopClient();
}
else if (NetworkServer.active)
{
NetworkManager.singleton.StopServer();
}
}
}