NetworkView.isMine 是否该物体控制

var isMine : bool

Description描述

Is the network view controlled by this object?

这个网格视是由这个物体控制吗?

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnNetworkInstantiate(NetworkMessageInfo info) {
	if (networkView.isMine)
		Debug.Log("New object instanted by me");
	else
		Debug.Log("New object instantiated by " + info.sender);
	}
}
function OnNetworkInstantiate (info : NetworkMessageInfo) {
if (networkView.isMine)
	Debug.Log("New object instanted by me");
else
	Debug.Log("New object instantiated by " + info.sender);
}
最后修改:2011年3月30日 Wednesday 16:43

本脚本参考基于Unity 3.4.1f5

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