当前位置: 首页>>代码示例>>C#>>正文


C# NetworkDisconnection类代码示例

本文整理汇总了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);
 }
开发者ID:terdened,项目名称:Tanks,代码行数:8,代码来源:Server.cs

示例2: OnDisconnectedFromServer

 void OnDisconnectedFromServer(NetworkDisconnection info)
 {
     GameObject[] gos = GameObject.FindGameObjectsWithTag("Player");
     foreach(GameObject go in gos) {
         Destroy(go);
     }
 }
开发者ID:Gerb11,项目名称:Unity,代码行数:7,代码来源:ClientMain.cs

示例3: OnDisconnectedFromServer

 void OnDisconnectedFromServer( NetworkDisconnection error)
 {
     curStatus = "Lost connection: "+ error;
     camera.enabled = true;
     gameObject.GetComponent<AudioListener>().enabled = true;
     CleanUp();
 }
开发者ID:KyleTheHack3r,项目名称:ServerController,代码行数:7,代码来源:FunctionDefine.cs

示例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);
    }
开发者ID:rameshvarun,项目名称:FTMoba,代码行数:8,代码来源:MatchManagement.cs

示例5: OnDisconnectedFromServer

 void OnDisconnectedFromServer( NetworkDisconnection info )
 {
     if ( Network.isClient ) {
         Debug.Log( "Disconnected from server: " + info.ToString() ); // при успешном либо не успешном отключении выводим результат
     } else {
         Debug.Log( "Connections closed" ); // выводим при выключении сервера Network.Disconnect
     }
 }
开发者ID:NextGenIntelligence,项目名称:HabrahabrUnityMultiplayer,代码行数:8,代码来源:MultiplayerMenu.cs

示例6: OnDisconnectedFromServer

    void OnDisconnectedFromServer(NetworkDisconnection info)
    {
        MasterServer.UnregisterHost ();

        //Go back to main menu
        string nameOfLevel = "main";
        Application.LoadLevel( nameOfLevel );
    }
开发者ID:Ronnrein,项目名称:bad-golf-community-edition,代码行数:8,代码来源:networkManagerServer.cs

示例7: OnDisconnectedFromServer

 public void OnDisconnectedFromServer(NetworkDisconnection info)
 {
     if(Network.isServer)
     foreach (var player in Network.connections) {
         Network.DestroyPlayerObjects(player);
         Network.RemoveRPCs(player);
     }
 }
开发者ID:DormantDreams,项目名称:IMiD-Prototype,代码行数:8,代码来源:NetworkManager.cs

示例8: OnDisconnectedFromServer

 public void OnDisconnectedFromServer(NetworkDisconnection info)
 {
     Debug.Log("Disconnected "+name);
     _LoaderGui.enabled = true;
     _LoaderGui.Print("Server closed connection");
     Application.LoadLevel(0);
     
 }
开发者ID:ConnectDeveloper01,项目名称:dorumon,代码行数:8,代码来源:Loader.cs

示例9: OnDisconnectedFromServer

 void OnDisconnectedFromServer(NetworkDisconnection info)
 {
     if (info == NetworkDisconnection.Disconnected)
     {
         
         connected = false;
     }
 }
开发者ID:esmayl,项目名称:De-Zuidlanden-Stage-project,代码行数:8,代码来源:Client.cs

示例10: OnDisconnectedFromServer

    public void OnDisconnectedFromServer(NetworkDisconnection info)
    {
        conneted = true;
        if(Preloading)
            Preloading.SetActive(false);

        if (TextInfo)
            TextInfo.text = "Disconnected!";
    }
开发者ID:sparxcrossroads,项目名称:UnitZ,代码行数:9,代码来源:ConnectingEvent.cs

示例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;
     }
 }
开发者ID:noahdayan,项目名称:Space-Dinosaurs,代码行数:9,代码来源:Connect.cs

示例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();
		}
	}
开发者ID:MizzKii,项目名称:WarB,代码行数:10,代码来源:NetworkControl.cs

示例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);
 }
开发者ID:niguerrac,项目名称:UnityUI,代码行数:10,代码来源:Chatter.cs

示例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");
 }
开发者ID:hansmei,项目名称:Iluminati,代码行数:10,代码来源:NetworkManager.cs

示例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");
     }
 }
开发者ID:Bruthur,项目名称:TDProject,代码行数:13,代码来源:sGameInfo.cs


注:本文中的NetworkDisconnection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。