{"id":211202,"date":"2014-02-03T13:06:02","date_gmt":"2014-02-03T09:06:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=211202"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=211202","title":{"rendered":"<span class=\"post_title\">\u041e\u0441\u043d\u043e\u0432\u044b \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0438\u0433\u0440\u044b \u043d\u0430 Unity3D<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<div style=\"text-align:center;\"><img decoding=\"async\"  src=\"http:\/\/habr.habrastorage.org\/post_images\/bf0\/6f2\/d1b\/bf06f2d1bcacad0ad0b09b2cd20481dc.png\"\/><\/div>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440!<\/p>\n<p>  \u042f, \u043a\u0430\u043a \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u0432\u0430\u0441, \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u043a\u043b\u043e\u043d\u043d\u0438\u043a \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0438\u0433\u0440. \u0412 \u043d\u0438\u0445 \u043c\u0435\u043d\u044f \u043f\u0440\u0435\u043b\u044c\u0449\u0430\u0435\u0442 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0434\u0443\u0445 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f, \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u044f \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f. \u0414\u0430 \u0438 \u0441\u0430\u043c\u0430 \u0438\u0434\u0435\u044f \u0432\u044b\u0445\u043e\u0434\u0430 \u0432 \u0441\u0432\u0435\u0442 \u0432\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0433\u0440 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u043e\u0431\u0443\u0436\u0434\u0430\u0435\u0442 \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e. <br \/>  \u0421 \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f \u0438 \u0441\u0430\u043c \u0432\u0437\u044f\u043b\u0441\u044f \u0437\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0418 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430 \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440\u0435 \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u2013 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0438\u0433\u0440\u044b \u043d\u0430 \u0434\u0432\u0438\u0436\u043a\u0435 <b>Unity3D<\/b>. \u0422\u0430\u043a\u0436\u0435 \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 <b>Network<\/b> \u0438 <b>NetworkView<\/b>, \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 <b><abbr title=\"Remote Procedure Call\">RPC<\/abbr><\/b> \u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445-\u0438\u0432\u0435\u043d\u0442\u0430\u0445. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0434\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0433\u0440\u044b \u0438, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0441\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Unity. \u0418\u0442\u0430\u043a\u2026<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>\u041a\u043b\u0430\u0441\u0441 Network<\/h5>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u00ab\u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u00bb. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438: \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043f\u0440\u0435\u0444\u0430\u0431\u0430.<\/p>\n<h6>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:<\/h6>\n<p>   <b>Network.Connect (string host, int remotePort, string password = &quot;&quot;)<\/b> \u2013 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 <i>host<\/i> \u0441 \u043f\u043e\u0440\u0442\u043e\u043c <i>remotePort<\/i> \u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u043c <i>password<\/i>. \u041c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 NetworkConnectionError.<\/p>\n<p>   <b>Network.InitializeServer(int connections, int listenPort, bool useNat)<\/b> \u2013 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 <i>connections<\/i>; \u043f\u043e\u0440\u0442 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 <i>listenPort<\/i>, \u0430 \u0442\u0430\u043a\u0436\u0435 <i>useNat<\/i>: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0438\u0431\u043e \u043d\u0435\u0442 <abbr title=\"Network Address Translation\">NAT<\/abbr>. \u0422\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 <i>NetworkConnectionError<\/i>.<\/p>\n<p>   <b>Network.InitializeSecurity()<\/b> \u2013 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 <i>Network.InitializeServer()<\/i> \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u0447\u0438\u0442\u0435\u0440\u0441\u0442\u0432\u0430. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0432 <a href=\"http:\/\/docs.unity3d.com\/Documentation\/ScriptReference\/Network.InitializeSecurity.html\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u041d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435!<\/p>\n<p>   <b>Network.Instantiate(Object prefab, Vector3 position, Quaternion rotation, int group)<\/b> \u2013 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u0440\u0435\u0444\u0430\u0431\u0430 <i>prefab<\/i> \u0432 \u0441\u0435\u0442\u0438 \u0432 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 <i>position<\/i> \u0441 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043e\u043c <i>rotation<\/i> \u0438 \u0433\u0440\u0443\u043f\u043f\u043e\u0439 <i>group<\/i>. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0435\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u2013 \u0434\u0430\u043b\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<h6>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430:<\/h6>\n<p>   <b>bool Network.isClient<\/b> \u0438 <b>bool Network.isServer<\/b> \u2013 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0430\u0448\u0430 \u0438\u0433\u0440\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u043b\u0438\u0431\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c. \u041e\u0431\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f <i>false<\/i>, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0441\u0435\u0440\u0432\u0435\u0440 \u0438\u043b\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443.<\/p>\n<p>   <b>string Network.incomingPassword<\/b> \u2013 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0437\u0430\u0434\u0430\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>   <b>NetworkPlayer Network.player<\/b> \u2013 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 <i>NetworkPlayer<\/i>.<\/p>\n<p>   <b>NetworkPeerType Network.peerType<\/b> \u2013 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f: <i>Disconnected<\/i> (\u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d), <i>Server<\/i> (\u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0435\u0440), <i>Client<\/i> (\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443), <i>Connecting<\/i> (\u043f\u043e\u043f\u044b\u0442\u043a\u0430, \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f).<\/p>\n<p>   <b>NetworkPlayer[] Network.connections<\/b> \u2013 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0435\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u0438\u0433\u0440\u043e\u043a\u043e\u0432. \u041d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0433\u0440\u043e\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<h6>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u0432\u0435\u043d\u0442\u044b (\u0434\u043b\u044f \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0442 MonoBehaviour):<\/h6>\n<p>   <b>OnConnectedToServer()<\/b> \u2013 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443.<\/p>\n<p>   <b>OnDisconnectedFromServer(NetworkDisconnection info)<\/b> \u2013 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u043f\u0440\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 <i>Network.Disconnect()<\/i>. \u0412 <i>info<\/i> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f: <i>LostConnection<\/i> (\u043f\u043e\u0442\u0435\u0440\u044f \u0441\u0432\u044f\u0437\u0438) \u0438 <i>Disconnected<\/i> (\u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438).<\/p>\n<p>   <b>OnFailedToConnect(NetworkConnectionError error)<\/b> \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. <i>error<\/i> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0442\u0438\u043f\u0430 <i>NetworkConnectionError<\/i>.<\/p>\n<p>   <b>OnNetworkInstantiate(NetworkMessageInfo info)<\/b> \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0435\u0441\u043b\u0438 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u043e\u0432\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043c\u0435\u0442\u043e\u0434\u043e\u043c <i>Network.Instantiate()<\/i>. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <i>info<\/i> \u0442\u0438\u043f\u0430 <i>NetworkMessageInfo<\/i>.<\/p>\n<p>   <b>OnPlayerConnected(NetworkPlayer player)<\/b> \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <i>player<\/i> \u0442\u0438\u043f\u0430 <i>NetworkPlayer<\/i>.<\/p>\n<p>   <b>OnPlayerDisconnected(NetworkPlayer player)<\/b> \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u0440\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <i>player<\/i> \u0442\u0438\u043f\u0430 <i>NetworkPlayer<\/i>.<\/p>\n<p>   <b>OnServerInitialized()<\/b> \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u044b\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d.<\/p>\n<p>   <b>OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info)<\/b> \u2014 \u0432\u0430\u0436\u043d\u044b\u0439 \u0438\u0432\u0435\u043d\u0442 \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0441 \u0441\u0435\u0442\u044c\u044e. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u2013 \u0434\u0430\u043b\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<h5>\u041a\u043b\u0430\u0441\u0441 NetwokView<\/h5>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u0438 \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0434\u043b\u044f Unity, \u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u043e\u043d \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0432 \u0441\u0435\u0442\u0438 \u0438 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 <abbr title=\"Remote Procedure Call\">RPC<\/abbr>.<br \/>  \u041e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 <i>NetworkStateSynchronization<\/i>:<\/p>\n<ul>\n<li><b>Off<\/b> \u2014 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b.<\/li>\n<li><b>ReliableDeltaCompressed<\/b> \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043b\u0438 \u043f\u0430\u043a\u0435\u0442 (<i>\u043f\u043e\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 TCP<\/i>).<\/li>\n<li><b>Unreliable<\/b> \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0443\u044e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u044f \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 (<i>\u043f\u043e\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 UDP<\/i>).<\/li>\n<\/ul>\n<h6>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:<\/h6>\n<p>   <b>networkView.RPC(string name, RPCMode mode, params object[] args)<\/b> \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 name, mode \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0435\u0439, <i>args<\/i> \u2013 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0435.<\/p>\n<p>   <b>networkView.RPC(string name, NetworkPlayer target, params object[] args)<\/b> \u2013 \u0442\u043e \u0436\u0435, \u0447\u0442\u043e \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0438\u0433\u0440\u043e\u043a\u0443 <i>NetworkPlayer<\/i>.<\/p>\n<h6>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430:<\/h6>\n<p>   <b>bool networkView.isMine<\/b> \u2013 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0435, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c. \u0412\u0435\u0441\u044c\u043c\u0430 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>   <b>Component networkView.observed<\/b> \u2013 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442, \u0442\u043e \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <i>OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info)<\/i>, \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u0432\u044b\u0448\u0435.<\/p>\n<p>   <b>NetworkPlayer networkView.owner<\/b> \u2013 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0435\u0435 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>   <b>NetworkStateSynchronization networkView.stateSynchronization<\/b> \u2014 \u0442\u0438\u043f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438: <i>Off<\/i>, <i>ReliableDeltaCompressed<\/i>, <i>Unreliable<\/i>.<\/p>\n<p>   <b>NetworkViewID networkView.viewID<\/b> \u2014 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432 \u0441\u0435\u0442\u0438 \u0434\u043b\u044f <i>NetworkView<\/i>.<\/p>\n<h5>\u0410\u0442\u0440\u0438\u0431\u0443\u0442 <abbr title=\"Remote Procedure Call\">RPC<\/abbr><\/h5>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u0438\u0437 \u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438 <abbr title=\"Remote Procedure Call\">RPC<\/abbr> \u2014 \u043a\u043b\u0430\u0441\u0441 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u044b\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 (\u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u0445). <br \/>  \u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0438\u0437 \u0441\u0435\u0442\u0438. \u0414\u043b\u044f \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <i>NetworkView<\/i>.<\/p>\n<h5>\u041c\u0435\u0442\u043e\u0434 <i>OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info)<\/i><\/h5>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0432 \u0441\u0435\u0442\u0438. \u041e\u043d \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u043b\u0438\u0431\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u0435\u0442\u0438.<br \/>  \u0412\u043e\u0442 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b\/\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u043c <i>Serialize: bool, char, short, int, float, Quaternion, Vector3, NetworkPlayer, NetworkViewID.<\/i><br \/>  \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0438\u0434\u0435\u0442 \u043b\u0438 \u043f\u0440\u0438\u0435\u043c \u043b\u0438\u0431\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <i>isReading<\/i> \u0438\u043b\u0438 <i>isWriting<\/i>.<\/p>\n<p>  \u041f\u0440\u0438\u0432\u043e\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"cs\">void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info) { \tVector3 syncPosition = Vector3.zero; \/\/ \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u0438\u0435\u043c\u043e\u043c \tif (stream.isWriting) { \t\tsyncPosition = rigidbody.position; \/\/ \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \t\tstream.Serialize(ref syncPosition); \/\/ \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0441 \u0441\u0435\u0442\u044c\u044e \t} else { \t\tstream.Serialize(ref syncPosition); \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0438\u0437 \u0441\u0435\u0442\u0438 \t\trigidbody.position = syncPosition; \/\/ \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0432 \u043d\u0430\u0448 \u043e\u0431\u044a\u0435\u043a\u0442. \t} } <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u0435\u043d, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0438 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u043d\u0430\u0448\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u00ab\u0434\u0435\u0440\u0433\u0430\u0442\u044c\u0441\u044f\u00bb. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0433\u043e, \u043d\u0443\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0435\u0439. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u2013 \u0434\u0430\u043b\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<h5>\u0418\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044f<\/h5>\n<p>  \u0421\u0443\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u0435\u0436\u0434\u0443 \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437 \u0441\u0435\u0442\u0438 \u043c\u044b \u043f\u043b\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u043d\u0430\u0448 \u043e\u0431\u044a\u0435\u043a\u0442 \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <a href=\"http:\/\/en.wikipedia.org\/wiki\/Linear_interpolation\">Lerp<\/a> \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u043a\u0440\u0430\u043d\u0430.<br \/>  \u0411\u0435\u0440\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u2014 \u043a\u0430\u043a \u043a\u043e\u043d\u0435\u0446, \u0438 \u043f\u043e \u043c\u0435\u0440\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u0434\u0440\u043e\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u043d\u0430\u0448 \u043e\u0431\u044a\u0435\u043a\u0442.  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\"  src=\"http:\/\/habr.habrastorage.org\/post_images\/3de\/50f\/0d8\/3de50f0d8485fca6f742591a18f61d79.png\"\/><\/div>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u0435\u0442\u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432: <a href=\"https:\/\/developer.valvesoftware.com\/wiki\/Source_Multiplayer_Networking\">Valve Developer Community \u2014 Source Multiplayer Networking<\/a><\/p>\n<h5>\u041f\u0440\u0438\u043c\u0435\u0440 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0438\u0433\u0440\u044b<\/h5>\n<p>  \u0418\u0442\u0430\u043a, \u0438\u043c\u0435\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0441\u043d\u043e\u0432\u0430\u0445, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0437\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0438\u0433\u0440\u044b. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f <i>NetworkView<\/i>. \u0412\u0430\u043c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 <i>ServerSide.cs<\/i> \u0438 \u043f\u0438\u0448\u0435\u043c \u0442\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;  [RequireComponent( typeof( NetworkView ) )] \/\/ \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 Unity \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 NetworkView. \u0414\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 NetworkStateSynchronization \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c Off.  public class ServerSide : MonoBehaviour { \tprivate int playerCount = 0; \/\/ \u0445\u0440\u0430\u043d\u0438\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \tpublic int PlayersCount { get { return playerCount; } } \/\/ \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043b\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435      void OnServerInitialized() {         SendMessage( &quot;SpawnPlayer&quot;, &quot;Player Server&quot; ); \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430     }      void OnPlayerConnected( NetworkPlayer player ) { \t\t++playerCount; \/\/ \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u0438\u0433\u0440\u043e\u043a\u043e\u0432         networkView.RPC( &quot;SpawnPlayer&quot;, player, &quot;Player &quot; + playerCount.ToString() ); \/\/ \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0443 \u0438\u0433\u0440\u043e\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043f\u0440\u0435\u0444\u0430\u0431\u0430     }      void OnPlayerDisconnected( NetworkPlayer player ) {         --playerCount; \/\/ \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0433\u0440\u043e\u043a\u043e\u0432         Network.RemoveRPCs( player ); \/\/ \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0438\u0433\u0440\u043e\u043a\u0430         Network.DestroyPlayerObjects( player ); \/\/ \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u043c \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u0433\u0440\u043e\u043a\u0430     } } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 <i>ClientSide.cs<\/i>:  <\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;  [RequireComponent( typeof( NetworkView ) )] \/\/ \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 Unity \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 NetworkView. \u0414\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 NetworkStateSynchronization \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c Off.  public class ClientSide : MonoBehaviour {     public GameObject playerPrefab; \/\/ \u043f\u0440\u0435\u0444\u0430\u0431 \u0438\u0433\u0440\u043e\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u0433\u0440\u044b     public Vector2 spawnArea = new Vector2( 8.0f, 8.0f ); \/\/ \u0437\u043e\u043d\u0430 \u0441\u043f\u0430\u0443\u043d\u0430      \tprivate Vector3 RandomPosition { \/\/ \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0432 \u0437\u043e\u043d\u0435 \u0441\u043f\u0430\u0443\u043d\u0430         get {             return transform.position +                     transform.right * ( Random.Range( 0.0f, spawnArea.x ) - spawnArea.x * 0.5f ) +                     transform.forward * ( Random.Range( 0.0f, spawnArea.y ) - spawnArea.y * 0.5f );         }     }      [RPC] \/\/ \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 Unity \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0438\u0437 \u0441\u0435\u0442\u0438     private void SpawnPlayer( string playerName ) {         Vector3 position = RandomPosition; \/\/ \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0430         GameObject newPlayer = Network.Instantiate( playerPrefab, position, Quaternion.LookRotation( transform.position - position, Vector3.up ), 0 ) as GameObject; \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0430 \u0432 \u0441\u0435\u0442\u0438         newPlayer.BroadcastMessage( &quot;SetPlayerName&quot;, playerName ); \/\/ \u0437\u0430\u0434\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0443 \u0438\u043c\u044f (\u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043f\u043e \u0441\u0435\u0442\u0438)     } \t \tvoid OnDisconnectedFromServer( NetworkDisconnection info ) {         Network.DestroyPlayerObjects( Network.player ); \/\/ \u0443\u0434\u0430\u043b\u044f\u0435\u043c\u0441\u044f \u0438\u0437 \u0438\u0433\u0440\u044b     } } <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0435\u0441\u0442\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u043d\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 <i>MainMenu.cs<\/i>:  <\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;  public class MultiplayerMenu : MonoBehaviour {     const int NETWORK_PORT = 4585; \/\/ \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043f\u043e\u0440\u0442     const int MAX_CONNECTIONS = 20; \/\/ \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439     const bool USE_NAT = false; \/\/ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c NAT?      private string remoteServer = &quot;127.0.0.1&quot;; \/\/ \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e localhost)      void OnGUI() {         if ( Network.peerType == NetworkPeerType.Disconnected ) { \/\/ \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d             if ( GUILayout.Button( &quot;Start Server&quot; ) ) { \/\/ \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u00bb                 Network.InitializeSecurity(); \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u0449\u0438\u0442\u0443                 Network.InitializeServer( MAX_CONNECTIONS, NETWORK_PORT, USE_NAT ); \/\/ \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440             }             GUILayout.Space(30f); \/\/ \u043e\u0442\u0441\u0442\u0443\u043f             remoteServer = GUILayout.TextField( remoteServer ); \/\/ \u043f\u043e\u043b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430             if ( GUILayout.Button( &quot;Connect to server&quot; ) ) { \/\/ \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f\u00bb                 Network.Connect( remoteServer, NETWORK_PORT ); \/\/ \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443             }         } else if ( Network.peerType == NetworkPeerType.Connecting ) { \/\/ \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f             GUILayout.Label( &quot;Trying to connect to server&quot; ); \/\/ \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0442\u0435\u043a\u0441\u0442         } else { \/\/ \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 ( NetworkPeerType.Server, NetworkPeerType.Client)             if ( GUILayout.Button( &quot;Disconnect&quot; ) ) {  \/\/ \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f\u00bb                 Network.Disconnect(); \/\/ \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u0441\u0435\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043b\u0438\u0431\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430             }         }     }      void OnFailedToConnect( NetworkConnectionError error ) {         Debug.Log( &quot;Failed to connect: &quot; + error.ToString() ); \/\/ \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u0430\u043c\u0443 \u043e\u0448\u0438\u0431\u043a\u0443     }      void OnDisconnectedFromServer( NetworkDisconnection info ) {         if ( Network.isClient ) { \t\t\tDebug.Log( &quot;Disconnected from server: &quot; + info.ToString() ); \/\/ \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u043b\u0438\u0431\u043e \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442         } else {             Debug.Log( &quot;Connections closed&quot; ); \/\/ \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Network.Disconnect()         }     }      void OnConnectedToServer() {         Debug.Log( &quot;Connected to server&quot; ); \/\/ \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443     } } <\/code><\/pre>\n<p>  \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0442\u044c\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u043e. \u0414\u0430\u043b\u0435\u0435 \u043f\u0438\u0448\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u043a\u043e\u043c <i>PlayerControls.cs<\/i>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <i>NetworkView<\/i>:  <\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;  [RequireComponent( typeof( Rigidbody ) )] \/\/ \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f Rigidbody  public class PlayerControls : MonoBehaviour { \t\/* \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438 *\/     private float lastSynchronizationTime; \/\/ \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438     private float syncDelay = 0f; \/\/ \u0434\u0435\u043b\u044c\u0442\u0430 \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439     private float syncTime = 0f; \/\/ \u0432\u0440\u0435\u043c\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438      private Vector3 syncStartPosition = Vector3.zero; \/\/\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438      private Vector3 syncEndPosition = Vector3.zero; \/\/ \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438      private Quaternion syncStartRotation = Quaternion.identity; \/\/ \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438     private Quaternion syncEndRotation = Quaternion.identity; \/\/ \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438      private NetworkView netView; \/\/ \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 NetworkView \t \tprivate string myName = &quot;&quot;; \/\/ \u043d\u0430\u0448\u0435 \u0438\u043c\u044f (\u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043c\u044b \u0435\u0433\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c) \tpublic string MyName { get { return myName; } } \/\/ \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043c\u0435\u043d\u0438 \tpublic float power = 20f;   \tvoid Awake () {         netView = gameObject.AddComponent( typeof( NetworkView ) ) as NetworkView; \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 NetworkView \u043d\u0430\u0448\u0435\u043c\u0443 \u0438\u0433\u0440\u043e\u0432\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443         netView.viewID = Network.AllocateViewID(); \/\/ \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432 \u0441\u0435\u0442\u0438         netView.observed = this; \/\/ \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 (\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442) \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438         netView.stateSynchronization = NetworkStateSynchronization.Unreliable; \/\/ \u043d\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441 \u043f\u043e\u0442\u0435\u0440\u044f\u043c\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430\u0448\u0435 \u043f\u0435\u0440\u0435\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f         lastSynchronizationTime = Time.time; \/\/ \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \t}  \tvoid FixedUpdate () {         if ( netView.isMine ) { \/\/ \u0435\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043d\u0430\u043c, \u0442\u043e \u043c\u044b \u0438\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f             float inputX = Input.GetAxis( &quot;Horizontal&quot; );             float inputY = Input.GetAxis( &quot;Vertical&quot; ); \t\t\tif ( inputX != 0.0f ) {                 rigidbody.AddTorque( Vector3.forward * -inputX * power, ForceMode.Impulse );             }             if ( inputY != 0.0f ) {                 rigidbody.AddTorque( Vector3.right * inputY * power, ForceMode.Impulse );             }         } else { \t\t\tsyncTime += Time.fixedDeltaTime;             rigidbody.position = Vector3.Lerp( syncStartPosition, syncEndPosition, syncTime \/ syncDelay ); \/\/ \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f             rigidbody.rotation = Quaternion.Lerp( syncStartRotation, syncEndRotation, syncTime \/ syncDelay ); \/\/ \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044f \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \t\t} \t}      void OnSerializeNetworkView( BitStream stream, NetworkMessageInfo info ) {         Vector3 syncPosition = Vector3.zero; \/\/ \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u0438         Vector3 syncVelocity = Vector3.zero; \/\/ \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0438\u043b\u044b         Quaternion syncRotation = Quaternion.identity; \/\/ \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430          if ( stream.isWriting ) { \/\/ \u0435\u0441\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0441\u0435\u0442\u044c, \u0442\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439             syncPosition = rigidbody.position;             stream.Serialize( ref syncPosition );              syncPosition = rigidbody.velocity;             stream.Serialize( ref syncVelocity );              syncRotation = rigidbody.rotation;             stream.Serialize( ref syncRotation );         } else { \/\/ \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0437 \u0441\u0435\u0442\u0438             stream.Serialize( ref syncPosition );             stream.Serialize( ref syncVelocity );             stream.Serialize( ref syncRotation );              syncTime = 0f; \/\/ \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438             syncDelay = Time.time - lastSynchronizationTime; \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0435\u043b\u044c\u0442\u0443 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438             lastSynchronizationTime = Time.time; \/\/ \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438              syncEndPosition = syncPosition + syncVelocity * syncDelay; \/\/ \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0434\u0432\u0438\u0436\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442             syncStartPosition = rigidbody.position; \/\/ \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0440\u0430\u0432\u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438              syncEndRotation = syncRotation; \/\/ \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043f\u043e\u0432\u043e\u0440\u043e\u0442             syncStartRotation = rigidbody.rotation; \/\/ \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0432\u043e\u0440\u043e\u0442         }     } \t \tvoid SetPlayerName( string name ) { \t\tmyName = name; \/\/ \u0437\u0430\u0434\u0430\u0435\u043c \u0438\u043c\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \t} } <\/code><\/pre>\n<p>  \u0417\u043d\u0430\u044e, \u0447\u0442\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0438\u0445. \u041a\u0430\u043a \u0432\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0437\u0434\u0435\u0441\u044c NetworkView \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u044d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u00ab\u0437\u0430\u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c\u00bb (\u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e <i>RequireComponent( typeof( Rigidbody ))<\/i>), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0432 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0435. <br \/>  \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u0441\u043b\u0443\u0447\u0430\u0439: \u043a\u043e\u0433\u0434\u0430, \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435 \u0434\u0435\u043b\u0430\u043b \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u044e, \u0438 \u0432\u0441\u0435 \u043c\u043e\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043b. \u0422\u0430\u043a \u0432\u043e\u0442 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0442\u043e, \u0447\u0442\u043e <i>Observed<\/i> \u0431\u044b\u043b \u043d\u0435 \u043c\u043e\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c, \u0430 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u0438\u043d\u0438-\u0438\u0433\u0440\u044b. <br \/>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0435\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u044b <i>MultiplayerMenu<\/i>, <i>ServerSide<\/i>, <i>ClientSide<\/i>. <br \/>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c. <br \/>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u0435\u0444\u0430\u0431 \u0438\u0433\u0440\u043e\u043a\u0430 (\u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0443\u0442 \u0448\u0430\u0440\u044b). \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u00ab\u0441\u0444\u0435\u0440\u0430\u00bb, \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0435\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442 <i>PlayerControls<\/i> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043f\u0440\u0435\u0444\u0430\u0431. \u041f\u0440\u0435\u0444\u0430\u0431 \u043f\u0435\u0440\u0435\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u043c \u043d\u0430 <i>ClientSide<\/i> \u0432 \u043f\u043e\u043b\u0435 <i>Player Prefab<\/i>. <br \/>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 (\u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u044f \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0438\u0433\u0440\u043e\u043a\u0430 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c <i>Run in background<\/i>) \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437. \u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043e\u043a\u043e\u043d \u0436\u043c\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440, \u043d\u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u2013 \u043a\u043b\u0438\u0435\u043d\u0442, \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>  <a href=\"https:\/\/github.com\/gatools\/HabrahabrUnityMultiplayer\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442<\/a>.<br \/>  *\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u043e \u043d\u0430 \u0441\u0443\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u043d\u0438 \u043d\u0435 \u0432\u043b\u0438\u044f\u044e\u0442.<\/p>\n<p>  \u0412\u0441\u0435\u0445 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<br \/>  \u0416\u0435\u043b\u0430\u044e \u0443\u0441\u043f\u0435\u0445\u043e\u0432 \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0438\u0433\u0440! \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/211202\/\"> http:\/\/habrahabr.ru\/post\/211202\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<div style=\"text-align:center;\"><img decoding=\"async\"  src=\"http:\/\/habr.habrastorage.org\/post_images\/bf0\/6f2\/d1b\/bf06f2d1bcacad0ad0b09b2cd20481dc.png\"\/><\/div>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440!<\/p>\n<p>  \u042f, \u043a\u0430\u043a \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u0432\u0430\u0441, \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u043a\u043b\u043e\u043d\u043d\u0438\u043a \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0438\u0433\u0440. \u0412 \u043d\u0438\u0445 \u043c\u0435\u043d\u044f \u043f\u0440\u0435\u043b\u044c\u0449\u0430\u0435\u0442 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0434\u0443\u0445 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f, \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u044f \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f. \u0414\u0430 \u0438 \u0441\u0430\u043c\u0430 \u0438\u0434\u0435\u044f \u0432\u044b\u0445\u043e\u0434\u0430 \u0432 \u0441\u0432\u0435\u0442 \u0432\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0433\u0440 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u043e\u0431\u0443\u0436\u0434\u0430\u0435\u0442 \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e. <br \/>  \u0421 \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f \u0438 \u0441\u0430\u043c \u0432\u0437\u044f\u043b\u0441\u044f \u0437\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0418 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430 \u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440\u0435 \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u2013 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0438\u0433\u0440\u044b \u043d\u0430 \u0434\u0432\u0438\u0436\u043a\u0435 <b>Unity3D<\/b>. \u0422\u0430\u043a\u0436\u0435 \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 <b>Network<\/b> \u0438 <b>NetworkView<\/b>, \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 <b><abbr title=\"Remote Procedure Call\">RPC<\/abbr><\/b> \u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445-\u0438\u0432\u0435\u043d\u0442\u0430\u0445. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0434\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0433\u0440\u044b \u0438, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0441\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Unity. \u0418\u0442\u0430\u043a\u2026  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-211202","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/211202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=211202"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/211202\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=211202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=211202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=211202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}