NetworkView.observed 监控

var observed : Component

Description描述

The component the network view is observing.

网络视图监控的组件。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void PrintNames(NetworkViewID[] 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
//打印数组中含有给出的viewID的对象的名称

function PrintNames(viewIDs : NetworkViewID[]) {
	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 16:12

本脚本参考基于Unity 3.4.1f5

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