MasterServer.UnregisterHost Manual     Reference     Scripting  
Scripting > Runtime Classes > MasterServer
MasterServer.UnregisterHost

static function UnregisterHost () : void

Description

Unregister this server from the master server.

Does nothing if the server is not registered or has already unregistered.

JavaScripts
function OnGUI() {
if (GUILayout.Button ("Disconnect")) {
Network.Disconnect();
MasterServer.UnregisterHost();
}
}

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void OnGUI() {
if (GUILayout.Button("Disconnect")) {
Network.Disconnect();
MasterServer.UnregisterHost();
}
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def OnGUI():
if GUILayout.Button('Disconnect'):
Network.Disconnect()
MasterServer.UnregisterHost()