NetworkView.viewID 视图ID

var viewID : NetworkViewID

Description描述

The ViewID of this network view.

网络视图的视图ID。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnNetworkInstantiate(NetworkMessageInfo info) {
		NetworkView[] networkViews = GetComponents<NetworkView>();
		Debug.Log("New prefab network instantiated with views - ");
		foreach (NetworkView view in networkViews) {
			Debug.Log("- " + view.viewID);
		}
	}
}
function OnNetworkInstantiate (info : NetworkMessageInfo) {
	var networkViews : NetworkView[] = GetComponents(NetworkView);
	Debug.Log("New prefab network instantiated with views - ");
	for (var view : NetworkView in networkViews)
	Debug.Log("- " + view.viewID);
}
最后修改:2011年3月30日 Wednesday 16:26

本脚本参考基于Unity 3.4.1f5

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