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);
}
Page last updated: 2011-1-2