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.peerType 端类型
static var peerType : NetworkPeerType
Description描述
The status of the peer type, i.e. if it is disconnected, connecting, server or client.
端类型的状态,即disconnected, connecting, server 或 client四种。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnGUI() {
if (Network.peerType == NetworkPeerType.Disconnected)
GUILayout.Label("Not Connected");
else
if (Network.peerType == NetworkPeerType.Connecting)
GUILayout.Label("Connecting");
else
GUILayout.Label("Network started");
}
}
function OnGUI() {
if (Network.peerType == NetworkPeerType.Disconnected)
GUILayout.Label("Not Connected");
else if (Network.peerType == NetworkPeerType.Connecting)
GUILayout.Label("Connecting");
else
GUILayout.Label("Network started");
}
最后修改:2011年5月17日 Tuesday 3:39