Network
- AllocateViewID
- CloseConnection
- connections
- connectionTesterIP
- connectionTesterPort
- Connect
- DestroyPlayerObjects
- Destroy
- Disconnect
- GetAveragePing
- GetLastPing
- HavePublicAddress
- incomingPassword
- InitializeSecurity
- InitializeServer
- Instantiate
- isClient
- isMessageQueueRunning
- isServer
- logLevel
- maxConnections
- minimumAllocatableViewIDs
- natFacilitatorIP
- natFacilitatorPort
- OnConnectedToServer
- OnDisconnectedFromServer
- OnFailedToConnectToM...
- OnFailedToConnect
- OnNetworkInstantiate
- OnPlayerConnected
- OnPlayerDisconnected
- OnSerializeNetworkView
- OnServerInitialized
- peerType
- player
- proxyIP
- proxyPassword
- proxyPort
- RemoveRPCsInGroup
- RemoveRPCs
- sendRate
- SetLevelPrefix
- SetReceivingEnabled
- SetSendingEnabled
- TestConnectionNAT
- TestConnection
- time
- useProxy
Network.OnFailedToConnect 当连接失败
function OnFailedToConnect (error : NetworkConnectionError) : void
Description描述
Called on the client when a connection attempt fails for some reason.
当一个连接因为某些原因失败时,从客户端调用这个函数。
The reason why it fails is passed in as a NetworkConnectionError enum.
失败的原因作为NetworkConnectionError枚举传入。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnFailedToConnect(NetworkConnectionError error) {
Debug.Log("Could not connect to server: " + error);
}
}
function OnFailedToConnect(error: NetworkConnectionError) {
Debug.Log("Could not connect to server: "+ error);
}
最后修改:2011年4月1日 Friday 21:21