NetworkView.stateSynchronization 状态同步

var stateSynchronization : NetworkStateSynchronization

Description描述

The type of NetworkStateSynchronization set for this network view.

为这个网络视图设置NetworkStateSynchronization的类型。

It is your repsonsibility to ensure that NetworkView's across all machines use the same reliability method. Do not change state reliability on the fly after state synchronization has already happened.

确保NetworkView在所有机器上使用相同可靠的方法是你的责任。在状态同步已经发生后不要在运行时改变状态的可靠性。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void Awake() {
		networkView.stateSynchronization = NetworkStateSynchronization.Unreliable;
	}
}
function Awake () {
// Start by switching state synch mode (before any networking is started).
//首先,切换状态同步模式(在任意网络开始之前)
networkView.stateSynchronization = NetworkStateSynchronization.Unreliable;
}
最后修改:2011年3月30日 Wednesday 16:21

本脚本参考基于Unity 3.4.1f5

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