本文整理汇总了C#中NetworkDisconnection类的典型用法代码示例。如果您正苦于以下问题:C# NetworkDisconnection类的具体用法?C# NetworkDisconnection怎么用?C# NetworkDisconnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NetworkDisconnection类属于命名空间,在下文中一共展示了NetworkDisconnection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDisconnectedFromServer
// При отключении от сервера
void OnDisconnectedFromServer(NetworkDisconnection info)
{
connected = false;
this.enabled = true;
this.gameObject.GetComponent<AudioListener>().enabled = true;
Application.LoadLevel(Application.loadedLevel);
}
示例2: OnDisconnectedFromServer
void OnDisconnectedFromServer(NetworkDisconnection info)
{
GameObject[] gos = GameObject.FindGameObjectsWithTag("Player");
foreach(GameObject go in gos) {
Destroy(go);
}
}
示例3: OnDisconnectedFromServer
void OnDisconnectedFromServer( NetworkDisconnection error)
{
curStatus = "Lost connection: "+ error;
camera.enabled = true;
gameObject.GetComponent<AudioListener>().enabled = true;
CleanUp();
}
示例4: OnDisconnectedFromServer
public void OnDisconnectedFromServer(NetworkDisconnection info)
{
ConnectToServer.disconnection = info;
Debug.Log("Disconnected from server: " + info);
ConnectToServer.states.Push(ConnectToServer.MenuState.Disconnection);
Application.LoadLevel(0);
}
示例5: OnDisconnectedFromServer
void OnDisconnectedFromServer( NetworkDisconnection info )
{
if ( Network.isClient ) {
Debug.Log( "Disconnected from server: " + info.ToString() ); // при успешном либо не успешном отключении выводим результат
} else {
Debug.Log( "Connections closed" ); // выводим при выключении сервера Network.Disconnect
}
}
示例6: OnDisconnectedFromServer
void OnDisconnectedFromServer(NetworkDisconnection info)
{
MasterServer.UnregisterHost ();
//Go back to main menu
string nameOfLevel = "main";
Application.LoadLevel( nameOfLevel );
}
示例7: OnDisconnectedFromServer
public void OnDisconnectedFromServer(NetworkDisconnection info)
{
if(Network.isServer)
foreach (var player in Network.connections) {
Network.DestroyPlayerObjects(player);
Network.RemoveRPCs(player);
}
}
示例8: OnDisconnectedFromServer
public void OnDisconnectedFromServer(NetworkDisconnection info)
{
Debug.Log("Disconnected "+name);
_LoaderGui.enabled = true;
_LoaderGui.Print("Server closed connection");
Application.LoadLevel(0);
}
示例9: OnDisconnectedFromServer
void OnDisconnectedFromServer(NetworkDisconnection info)
{
if (info == NetworkDisconnection.Disconnected)
{
connected = false;
}
}
示例10: OnDisconnectedFromServer
public void OnDisconnectedFromServer(NetworkDisconnection info)
{
conneted = true;
if(Preloading)
Preloading.SetActive(false);
if (TextInfo)
TextInfo.text = "Disconnected!";
}
示例11: OnDisconnectedFromServer
void OnDisconnectedFromServer(NetworkDisconnection info)
{
Debug.Log("This SERVER OR CLIENT has disconnected from a server");
if(Application.loadedLevelName == "NetworkPrototype")
{
Application.LoadLevel("Menu");
MainMenuGUI.network = false;
}
}
示例12: OnDisconnectedFromServer
void OnDisconnectedFromServer(NetworkDisconnection info)
{
if(MultiPlayer.state != GameState.EndGame) {
Debug.Log("Server Disconnected.");
Application.LoadLevel("Menu");
MultiPlayer.state = GameState.Error;
MultiPlayer.errorLog = info.ToString();
MultiPlayer.playerList.Clear();
}
}
示例13: OnDisconnectedFromServer
void OnDisconnectedFromServer(NetworkDisconnection info)
{
if (Network.isServer)
SystemMessage("Server connection lost!", Network.player);
else
if (info == NetworkDisconnection.LostConnection)
SystemMessage("Lost connection to server!", Network.player);
else
SystemMessage("Successfully diconnected from server.", Network.player);
}
示例14: OnDisconnectedFromServer
void OnDisconnectedFromServer(NetworkDisconnection info)
{
if (Network.isServer)
log.Debug("Local server connection disconnected");
else
if (info == NetworkDisconnection.LostConnection)
log.Debug("Lost connection to the server");
else
log.Debug("Successfully diconnected from the server");
}
示例15: OnDisconnectedFromServer
//-------------------------------Client events------------------------------
//Called on client on player's disconnection
void OnDisconnectedFromServer(NetworkDisconnection info)
{
if (Network.isServer) {
GameObject.Destroy(playerSettings.gameObject);
Application.LoadLevel("StartMenu");
}
else {
GameObject.Destroy(playerSettings.gameObject);
Application.LoadLevel("StartMenu");
}
}