NetworkView.Find 查找

static function Find (viewID : NetworkViewID) : NetworkView

Description描述

Find a network view based on a NetworkViewID.

基于NetworkViewID查找一个网络视图。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void PrintNames(ArrayList viewIDs) {
		foreach (NetworkViewID ID in viewIDs) {
			Debug.Log("Finding " + ID);
			NetworkView view = NetworkView.Find(ID);
			Debug.Log(view.observed.name);
		}
	}
}
// Print the names of the objects which have the view IDs given in the array
// 打印物体的名称,这些物体具有数组中给定的视图ID

function PrintNames(viewIDs : Array) {
	for (var ID : NetworkViewID in viewIDs) {
		Debug.Log("Finding "+ ID);
		var view : NetworkView = NetworkView.Find(ID);
		Debug.Log(view.observed.name);
	}
}
最后修改:2011年3月30日 Wednesday 17:21

本脚本参考基于Unity 3.4.1f5

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