public void StopHosting()
 {
     if (isServer)
     {
         StopHost();
         NetworkServer.ClearLocalObjects();
         NetworkServer.ClearSpawners();
     }
     if (isClient)
     {
         StopHost();
         StopClient();
     }
     if (MyNetDiscovery.running)
     {
         MyNetDiscovery.StopBroadcast();
     }
     StopAllCoroutines();
     NetworkServer.Reset();
     NetworkTransport.Init();
     NetworkTransport.Shutdown();
     isServer = false;
     isClient = false;
     TimeManager.Instance.gameObject.SetActive(false);
     UIManager.Instance.Connection();
 }
Exemple #2
0
 void CleanUp()
 {
     StopHost();
     StopClient();
     NetworkServer.ClearLocalObjects();
     NetworkServer.ClearSpawners();
     NetworkServer.Reset();
 }
    private static void CleanUpHost()
    {
        return;

        NetworkServer.ClearHandlers();
        NetworkServer.ClearLocalObjects();
        NetworkServer.DisconnectAll();
    }
Exemple #4
0
 public void StopHosting()
 {
     if (isServer)
     {
         StopHost();
         NetworkServer.ClearLocalObjects();
         NetworkServer.ClearSpawners();
     }
     if (isClient)
     {
         StopHost();
         StopClient();
     }
     StopAllCoroutines();
     NetworkServer.Reset();
     AutoConnectButton.GetComponentInChildren <Text>().text = TextManager.Instance.Search;
     EnableButtons();
     UIManager.Instance.ResetMenus();
 }
Exemple #5
0
 public void ResetServer()
 {
     NetworkServer.ClearLocalObjects();
     NetworkServer.Reset();
     NetworkServer.Shutdown();
 }
 public override void OnEnter()
 {
     base.OnEnter();
     NetworkServer.ClearLocalObjects();
     Finish();
 }
Exemple #7
0
 // Use this for initialization
 void Start()
 {
     NetworkServer.ClearLocalObjects();
 }