Files
UnrealEngineUWP/Engine/Documentation/Source/Gameplay/HowTo/Networking/ReplicateVariable/ReplicateVariableOverview.CHN.udn
2016-06-13 13:06:55 -04:00

33 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
INTSourceChangelist:2735882
Availability: Public
Title:同步变量
Crumbs: %ROOT%, Gameplay
Description:在多人游戏中同步变量的指南。
Version: 4.9
Parent:Gameplay
type:how-to
order:17
[EXCERPT:Overview]
正如 [Actors](Gameplay\HowTo\Networking\ReplicateActor)和 [Functions](Gameplay\HowTo\Networking\ReplicateFunction)一样,变量也可通过网络同步。
对游戏性十分重要的变量应仅在网络授权者(服务器)上修改,然后在需要的时候才同步到到远程机器(客户端)上。
您不希望让客户端定义何时更改变量,因为这样会导致作弊(例如,设置生命、弹药或经验值)。
您可以将变量设置为 Replicated此设置表示变量将对从服务器同步到客户端的变量生成一一对应的副本。或者您可以使用 RepNotify
它不仅可以执行 Replicated 的所有操作,还将提供一个函数,该函数将在变量连接到更新时被调用并同时在服务器和客户端机器上执行。
[/EXCERPT:Overview]
## 设置
关于使用蓝图设置同步变量的详细信息,请访问以下链接:
[REGION:buttonlist]
* [](Gameplay\HowTo\Networking\ReplicateVariable\Blueprints)
[/REGION]