MonoBehaviour
- Awake
- CancelInvoke
- FixedUpdate
- InvokeRepeating
- Invoke
- IsInvoking
- LateUpdate
- OnApplicationFocus
- OnApplicationPause
- OnApplicationQuit
- OnBecameInvisible
- OnBecameVisible
- OnCollisionEnter
- OnCollisionExit
- OnCollisionStay
- OnConnectedToServer
- OnControllerColliderHit
- OnDestroy
- OnDisable
- OnDisconnectedFromServer
- OnDrawGizmosSelected
- OnDrawGizmos
- OnEnable
- OnFailedToConnectToM...
- OnFailedToConnect
- OnGUI
- OnJointBreak
- OnLevelWasLoaded
- OnMasterServerEvent
- OnMouseDown
- OnMouseDrag
- OnMouseEnter
- OnMouseExit
- OnMouseOver
- OnMouseUpAsButton
- OnMouseUp
- OnNetworkInstantiate
- OnParticleCollision
- OnPlayerConnected
- OnPlayerDisconnected
- OnPostRender
- OnPreCull
- OnPreRender
- OnRenderImage
- OnRenderObject
- OnSerializeNetworkView
- OnServerInitialized
- OnTriggerEnter
- OnTriggerExit
- OnTriggerStay
- OnWillRenderObject
- Reset
- StartCoroutine
- Start
- StopAllCoroutines
- StopCoroutine
- Update
- useGUILayout
MonoBehaviour.OnPlayerDisconnected 当玩家断开连接
function OnPlayerDisconnected (player : NetworkPlayer) : void
Description描述
Called on the server whenever a player disconnected from the server.
当一个玩家从服务器上断开时在服务器端调用。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnPlayerDisconnected(NetworkPlayer player) {
Debug.Log("Clean up after player " + player);
Network.RemoveRPCs (player);
Network.DestroyPlayerObjects (player);
}
}
function OnPlayerDisconnected(player : NetworkPlayer ) {
Debug.Log ("Clean up after player " + player);
Network.RemoveRPCs (player);
Network.DestroyPlayerObjects (player);
}
最后修改:2011年1月2日 Sunday 18:25