Version: 2020.1
Network Transform
Network Transform Visualizer

Network Transform Child

Note: UNet is deprecated, and will be removed from Unity in the future. A new system is under development. For more information and next steps see this blog post.

Network Transform Child 组件可将游戏对象的子游戏对象的位置和旋转与 Network Transform 组件同步。如果需要同步某个联网游戏对象的独立运动子对象,则应使用此组件。

要使用 Network Transform Child 组件,请将其与 Network Transform 附加到同一个父游戏对象,然后使用 Target 字段来定义要将组件设置应用到的子游戏对象。在一个父游戏对象上可以设置多个 Network Transform Child 组件。

Network Transform Child 组件
Network Transform Child 组件
属性 功能
Network Send Rate (seconds) 设置每秒的网络更新数。对于在创建后不需要更新的游戏对象,比如玩家生成的非交互式效果(例如,玩家身后的无法交互的尘埃云团),可以将此滑动条设置为 0。
Target 要同步的子变换。(请注意,此组件位于父对象而不是子对象上,因此应使用此字段指定子对象)。
Movement Threshold 设置在不发送移动同步更新的情况下游戏对象可以移动的距离。
Interpolate Movement Factor 使用此属性可启用和控制同步运动的插值。该数字越大,游戏对象插入到目标位置的速度越快。如果将其设置为 0,则游戏对象将贴靠到新位置。
Interpolate Rotation Factor 使用此属性可启用和控制同步旋转的插值。该数字越大,游戏对象插入到目标旋转的速度越快。如果将其设置为 0,则游戏对象将贴靠到新旋转。
Rotation Axis 定义应同步的一个或多个旋转轴。默认设置为 XYZ(全 3D)。
Compress Rotation 如果压缩旋转数据,则发送的数据量较低,旋转同步的精度较低。
None 选择此选项将不对旋转同步应用任何压缩。这是默认选项。
Low 选择此选项可对旋转同步应用低压缩量。此选项可减少为旋转数据发送的信息量。
High 选择此选项可对旋转同步应用高压缩量。此选项为旋转数据发送最少的信息。

此组件不使用物理系统,可同步子游戏对象的位置和旋转,并向更新后的值进行插值。使用 Interpolate Movement FactorInterpolate Rotation Factor 可自定义插值的速率。

具有 Network Transform Child 组件的游戏对象还必须具有 Network Identity 组件。在某个游戏对象上创建 Network Transform Child 组件时,Unity 还将在该游戏对象上创建 Network Identity 组件(如果还没有此组件)。

Network Transform
Network Transform Visualizer