Network.RemoveRPCs 移除RPC

static function RemoveRPCs (playerID : NetworkPlayer) : void

Description描述

Remove all RPC functions which belong to this player ID.

移除所有属于这个玩家的ID的RPC函数。

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);
}

• static function RemoveRPCs (playerID : NetworkPlayer, group : int) : void

Description描述

Remove all RPC functions which belong to this player ID and were sent based on the given group.

移除属于这个玩家ID和发送基于给定组的所有RPC函数。

• static function RemoveRPCs (viewID : NetworkViewID) : void

Description描述

Remove the RPC function calls accociated with this view ID number.

移除所有与这个viewID数相关的RPC函数调用。

Page last updated: 2011-4-4