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函数调用。

最后修改:2011年4月4日 Monday 16:25

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。