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);
}
Page last updated: 2011-3-30