本文整理汇总了C#中NetworkDisconnection类的典型用法代码示例。如果您正苦于以下问题:C# NetworkDisconnection类的具体用法?C# NetworkDisconnection怎么用?C# NetworkDisconnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NetworkDisconnection类属于命名空间,在下文中一共展示了NetworkDisconnection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: OnDisconnectedFromServer
void OnDisconnectedFromServer(NetworkDisconnection info)
{
playerCount--;
if (Network.isServer)
GUI.Label(new Rect(10,Screen.height - 50,500,30),"Local server connection disconnected");
else
if (info == NetworkDisconnection.LostConnection)
GUI.Label(new Rect(10,Screen.height - 50,500,30),"Lost connection to the server");
else
GUI.Label(new Rect(10,Screen.height - 50,500,30),"Successfully diconnected from the server");
}
开发者ID:nghoang,项目名称:WestbuildingFireDemo,代码行数:11,代码来源:GameMenu.cs
示例17: OnDisconnectedFromServer
void OnDisconnectedFromServer(NetworkDisconnection info)
{
// Disconnected from server
// Pause game and resume cursor
if (GameObject.FindObjectOfType<LockCursor>()) {
GameObject.FindObjectOfType<LockCursor>().enabled = false;
}
Time.timeScale = 0;
Screen.showCursor = true;
Screen.lockCursor = false;
}
开发者ID:dream144,项目名称:altspacevr-project-unity-cursor,代码行数:11,代码来源:SceneManager.cs
示例18: OnDisconnectedFromServer
void OnDisconnectedFromServer(NetworkDisconnection info)
{
//Disconnected from the server for some reason
if (info == NetworkDisconnection.LostConnection) {
Debug.Log ("Lost connection to the server");
} else {
Debug.Log ("successfully disconnected from the server");
}
//Go back to main menu
string nextLevel = "main";
Application.LoadLevel( nextLevel );
}
开发者ID:ChubBBoy,项目名称:bad-golf-community-edition,代码行数:13,代码来源:networkManagerClient.cs
示例19: OnDisconnectedFromServer
public void OnDisconnectedFromServer(NetworkDisconnection reason)
{
print("Disconnected: " + reason);
ErrorPopup.Error("Disconnected from server: " + reason);
var game = GamePersistence.LoadGame("kestrel", HighLogic.SaveFolder, false, false);
if (game == null)
print("ERROR: Kestrel.sfs persistence file not found! Not reverting to original state!");
else
{
HighLogic.CurrentGame = game;
HighLogic.CurrentGame.flightState.Load();
}
_updateGui = true;
}
开发者ID:Arduinology,项目名称:Khylib,代码行数:14,代码来源:Kestrel.cs
示例20: NetworkClientConnectionEventArgs
public NetworkClientConnectionEventArgs(NetworkDisconnection disconnection)
{
if ( disconnection == NetworkDisconnection.Disconnected )
{
m_Failure = "Disconnected";
}
else if ( disconnection == NetworkDisconnection.LostConnection )
{
m_Failure = "Lost Connection";
}
else
{
m_Failure = "Unknown";
}
}
开发者ID:jrp77,项目名称:projectn,代码行数:15,代码来源:uScript_NetworkClientConnection.cs
注:本文中的NetworkDisconnection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论