MonoBehaviour
.OnPlayerDisconnected
Manual
Reference
Scripting
Scripting
>
Runtime Classes
>
MonoBehaviour
MonoBehaviour
.OnPlayerDisconnected
Menu
Overview
Runtime Classes
Attributes
Enumerations
Editor Classes
Enumerations
History
Index
MonoBehaviour
All Members
Variables
useGUILayout
Functions
CancelInvoke
Invoke
InvokeRepeating
IsInvoking
StartCoroutine
StopAllCoroutines
StopCoroutine
Overridable Functions
Awake
FixedUpdate
LateUpdate
OnApplicationFocus
OnApplicationPause
OnApplicationQuit
OnBecameInvisible
OnBecameVisible
OnCollisionEnter
OnCollisionExit
OnCollisionStay
OnConnectedToServer
OnControllerColliderHit
OnDestroy
OnDisable
OnDisconnectedFromServer
OnDrawGizmos
OnDrawGizmosSelected
OnEnable
OnFailedToConnect
OnFailedToConnectToMasterServer
OnGUI
OnJointBreak
OnLevelWasLoaded
OnMasterServerEvent
OnMouseDown
OnMouseDrag
OnMouseEnter
OnMouseExit
OnMouseOver
OnMouseUp
OnNetworkInstantiate
OnParticleCollision
OnPlayerConnected
OnPlayerDisconnected
OnPostRender
OnPreCull
OnPreRender
OnRenderImage
OnRenderObject
OnSerializeNetworkView
OnServerInitialized
OnTriggerEnter
OnTriggerExit
OnTriggerStay
OnWillRenderObject
Reset
Start
Update
Class Functions
print
Inherited Variables
animation
audio
camera
collider
constantForce
enabled
gameObject
guiText
guiTexture
hideFlags
hingeJoint
light
name
networkView
particleEmitter
renderer
rigidbody
tag
transform
Inherited Functions
BroadcastMessage
CompareTag
GetComponent
GetComponent.<T>
GetComponentInChildren
GetComponentInChildren.<T>
GetComponents
GetComponents.<T>
GetComponentsInChildren
GetComponentsInChildren.<T>
GetInstanceID
SendMessage
SendMessageUpwards
ToString
Inherited Class Functions
Destroy
DestroyImmediate
DontDestroyOnLoad
FindObjectOfType
FindObjectsOfType
Instantiate
Instantiate.<T>
operator !=
operator ==
operator bool
function
OnPlayerDisconnected (player :
NetworkPlayer
) :
void
Description
Called on the server whenever a player disconnected from the server.
JavaScripts
JavaScript
C#
Boo
function
OnPlayerDisconnected(player :
NetworkPlayer
) {
Debug.Log
(
"Clean up after player "
+ player);
Network.RemoveRPCs
(player);
Network.DestroyPlayerObjects
(player);
}
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);
}
}
import
UnityEngine
import
System.Collections
class
example(MonoBehaviour):
def OnPlayerDisconnected(player as
NetworkPlayer
):
Debug.Log
(('Clean up after player ' + player))
Network.RemoveRPCs
(player)
Network.DestroyPlayerObjects
(player)