{"id":410967,"date":"2024-06-29T21:41:39","date_gmt":"2024-06-29T21:41:39","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=410967"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=410967","title":{"rendered":"<span>\u0414\u043e\u043f\u0438\u043b\u0438\u0432\u0430\u0435\u043c VirtualMouse \u0432 \u043d\u043e\u0432\u043e\u0439 Input System, \u0434\u043b\u044f \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430 \u0432 Unity<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9dd\/cdd\/bef\/9ddcddbefa3e09195a8b8e97199f4edd.PNG\" alt=\"\u041f\u0430\u043a\u0435\u0442 Input System \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a\u0435\" title=\"\u041f\u0430\u043a\u0435\u0442 Input System \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a\u0435\" width=\"851\" height=\"412\"\/><\/p>\n<div><figcaption>\u041f\u0430\u043a\u0435\u0442 Input System \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a\u0435<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0427\u0438\u0442\u0430\u044e \u0425\u0430\u0431\u0440 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0435\u0433\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f, \u043d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0442\u0430\u043b \u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0440\u0435\u0448\u0438\u043b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e. \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0412\u0435\u043d\u0438\u0430\u043c\u0438\u043d \u0410\u0444\u0430\u043d\u0430\u0441\u044c\u0435\u0432 \u0438 \u044f c\u043e\u043b\u043e \u0438\u043d\u0434\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0432 Unity. \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0441\u044c \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u0434\u0432\u0438\u0436\u043a\u0430 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c \u043a\u0430\u043a \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c VirtualMouse \u0438\u0437 \u043d\u043e\u0432\u043e\u0433\u043e Input System Unity \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p>\u0412 \u0441\u0432\u043e\u0435\u0439 \u043d\u043e\u0432\u043e\u0439 \u0438\u0433\u0440\u0435 VICCP-2 Core, \u044f \u0440\u0435\u0448\u0438\u043b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430 \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b \u043d\u043e\u0432\u044b\u0439 Input System. \u041e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 \u043d\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0438 \u0432 <a href=\"https:\/\/docs.unity3d.com\/Packages\/com.unity.inputsystem@1.4\/api\/UnityEngine.InputSystem.UI.VirtualMouseInput.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u0431\u044b\u043b\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u044d\u0442\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0412 \u043f\u0430\u043a\u0435\u0442\u0435 \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432\u044b\u0448\u0435).<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c9b\/d2f\/74f\/c9bd2f74fa75f10fd310169bef455a2e.PNG\" alt=\"\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Virtual Mouse\" title=\"\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Virtual Mouse\" width=\"488\" height=\"722\"\/><\/p>\n<div><figcaption>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Virtual Mouse<\/figcaption><\/div>\n<\/figure>\n<p>\u0423 \u043f\u0430\u043a\u0435\u0442\u0430 \u0435\u0441\u0442\u044c 2 \u0440\u0435\u0436\u0438\u043c\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430: Hardware \u0438 Software. \u0418 \u0442\u0443\u0442 \u0436\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0443 \u043c\u044b\u0448\u043a\u0438 \u0438 \u0443 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430 \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u044b. \u041f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 Hardware \u043a\u0443\u0440\u0441\u043e\u0440\u0430, \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u0441 \u043c\u044b\u0448\u043a\u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0430\u043b\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0412 \u0434\u043e\u0432\u0435\u0441\u043e\u043a \u043f\u0440\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0441 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430  \u043a\u0443\u0440\u0441\u043e\u0440 \u0432\u044b\u0445\u043e\u0434\u0438\u043b \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u044d\u043a\u0440\u0430\u043d\u0430. \u0417\u0443\u043c \u043a\u043e\u043b\u0435\u0441\u0438\u043a\u0430 \u043d\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f. \u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441\u043b\u043e\u0436\u0438\u043b\u0430\u0441\u044c, \u0447\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. <\/p>\n<p>\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u044f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u0435\u0437 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041d\u0430\u0448\u0435\u043b \u043a\u0443\u0447\u0443 \u0444\u043e\u0440\u0443\u043c\u043e\u0432, \u0440\u043e\u043b\u0438\u043a\u043e\u0432 \u043d\u0430 \u044e\u0442\u0443\u0431\u0435 \u0433\u0434\u0435 \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u043e. \u041d\u043e \u043a \u043c\u043e\u0435\u043c\u0443 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u044e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0448\u0435\u043b, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043e\u0434\u043d\u043e\u0433\u043e <a href=\"https:\/\/www.youtube.com\/watch?v=Y3WNwl1ObC8&amp;t=1293s\" rel=\"noopener noreferrer nofollow\">\u0440\u043e\u043b\u0438\u043a\u0430<\/a>, \u043d\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043c\u0435\u043d\u044f \u043d\u0435 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u043b. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u043f\u0430\u043a\u0435\u0442 \u0441\u0442\u0430\u0432\u0438\u0442 1.3.0 \u0432\u0435\u0440\u0441\u0438\u044e, \u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0435\u0441\u0442\u044c \u0443\u0436\u0435 \u043d\u0430 1.5.1. \u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0433\u0438\u0442\u0445\u0430\u0431 \u043e\u0442 Unity \u0438 \u0431\u0435\u0437 \u0442\u0440\u0443\u0434\u0430 \u043d\u0430\u0448\u0435\u043b \u0442\u0430\u043c \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043c\u043d\u0435 <a href=\"https:\/\/github.com\/Unity-Technologies\/InputSystem\/blob\/develop\/Packages\/com.unity.inputsystem\/InputSystem\/Plugins\/UI\/VirtualMouseInput.cs\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430<\/a>. \u0418 \u0442\u0430\u043c \u044f \u0443\u0432\u0438\u0434\u0435\u043b \u044d\u0442\u043e:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/def\/f9c\/ead\/deff9cead9b36b7b038377973f9ed746.PNG\" alt=\"TO DO 2023\" title=\"TO DO 2023\" width=\"1207\" height=\"465\"\/><\/p>\n<div><figcaption>TO DO 2023<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0430\u0437\u043d\u0438\u0446\u044b \u0443 \u0444\u0430\u0439\u043b\u0430 \u0438\u0437 2019 \u0438 \u0444\u0430\u0439\u043b\u0430 2023 \u0432\u0435\u0440\u0441\u0438\u0438 1.5.1 \u043d\u0435\u0442. \u0417\u0430 3 \u0433\u043e\u0434\u0430, \u0432\u0441\u0435 \u044d\u0442\u0438 &#171;TODO&#187; \u0442\u0430\u043a \u0438 \u043d\u0435 \u0431\u044b\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b (\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 Unity, \u043d\u043e \u0441\u0430\u043c \u0434\u0432\u0438\u0436\u043e\u043a \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5bd\/ea1\/95a\/5bdea195acd69a0ca182388780148fa0.PNG\" alt=\"TO DO 2019\" title=\"TO DO 2019\" width=\"1249\" height=\"360\"\/><\/p>\n<div><figcaption>TO DO 2019<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043b\u0430 \u0431\u0435\u0437\u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 &#171;\u0438\u043d\u043f\u0443\u0442 \u0441\u0438\u0441\u0442\u0435\u043c&#187;, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043c \u043a\u0430\u043a\u0438\u0445 \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0417\u0430\u0442\u0435\u043c, \u044f \u043f\u043e\u043b\u0435\u0437 \u043d\u0430 \u0430\u0441\u0441\u0435\u0442\u0441\u0442\u043e\u0440, \u0438 \u043d\u0430\u0448\u0435\u043b \u0442\u0430\u043c \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0430\u0441\u0441\u0435\u0442 <a href=\"https:\/\/assetstore.unity.com\/packages\/tools\/utilities\/rewired-21676\" rel=\"noopener noreferrer nofollow\">Rewired<\/a>. \u0422\u0443\u0442 \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0435\u0433\u043e, \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u0441\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442, \u0438\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0435\u043c\u0443. \u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0440\u043e\u0434\u043d\u043e\u0439 VirtualMouse \u043e\u0442 Unity \u043d\u0435\u0442. \u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043b, \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u043e\u0438\u0441\u043a\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043e\u043f\u044b\u0442 \u0438 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u043b\u044e\u0434\u0438 \u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u0441\u0442\u0443\u043f\u043e\u0440 \u0438 \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431 Unity, \u043c\u043e\u0436\u0435\u0442 \u0441\u043f\u0430\u0441\u0442\u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e\u0442 \u043e \u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0438. \u0414\u0432\u0438\u0436\u043e\u043a \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0447\u0430\u0441\u0442\u043e \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435. \u0410 \u0435\u0449\u0451 \u043c\u043d\u0435 \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0437\u0430\u0431\u0430\u0432\u043d\u043e\u0439, \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442. <\/p>\n<p>\u042f \u043d\u0435 \u0433\u043e\u0440\u0435\u043b \u0436\u0435\u043b\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u044c \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u0430\u0441\u0441\u0435\u0442 \u0438 \u0436\u0430\u0431\u0430 \u043c\u0435\u043d\u044f \u0442\u0430\u043a \u0437\u0430\u0434\u0430\u0432\u0438\u043b\u0430, \u0447\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u044f \u0440\u0435\u0448\u0438\u043b \u0437\u0430\u043b\u0435\u0437\u0442\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u0438 \u0434\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0438 &#171;TODO&#187; \u0441\u0430\u043c. \u0422\u0430\u043a \u0436\u0435 \u0432\u043b\u0435\u0437\u0442\u044c \u0432 \u043a\u043e\u0434 Unity, \u0443\u0436\u0435 \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0439 \u0447\u0435\u043b\u043b\u0435\u043d\u0434\u0436. \u0418\u0442\u0430\u043a \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c:<\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u0440\u0435\u0437\u0430\u0435\u043c \u0432\u0435\u0441\u044c \u043a\u043b\u0430\u0441\u0441 \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439, \u0442\u0430\u043a \u0436\u0435 \u043c\u0435\u043d\u044f\u0435\u043c \u0438\u043c\u044f \u043d\u0430 &#171;VirtualMouseV&#187;. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u043b\u0438 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0438 \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">public class VirtualMouseV : MonoBehaviour<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0422\u0443\u0442 \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0443 &#171;InputSystem.DisableDevice(m_SystemMouse);&#187;. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430, \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u043b\u0430 \u043c\u044b\u0448\u043a\u0443 (\u0417\u0430\u0447\u0435\u043c?):<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">private void TryEnableHardwareCursor()         {             var devices = InputSystem.devices;             for (var i = 0; i &lt; devices.Count; ++i)             {                 var device = devices[i];                 if (device.native &amp;&amp; device is Mouse mouse)                 {                     m_SystemMouse = mouse;                     break;                 }             }              if (m_SystemMouse == null)             {                 if (m_CursorGraphic != null)                     m_CursorGraphic.enabled = true;                 return;             }              \/\/ \u0443\u0431\u0440\u0430\u043b \u0447\u0442\u043e\u0431\u044b \u043c\u044b\u0448\u043a\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c             \/\/ InputSystem.DisableDevice(m_SystemMouse);              \/\/ Sync position.             if (m_VirtualMouse != null)                 m_SystemMouse.WarpCursorPosition(m_VirtualMouse.position.ReadValue());              \/\/ Turn off mouse cursor image.             if (m_CursorGraphic != null)                 m_CursorGraphic.enabled = false;         }<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u0423\u0431\u0438\u0440\u0430\u0435\u043c &#171;TryFindCanvas()&#187;. \u0411\u0443\u0434\u0435\u043c \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u043d\u0432\u0430\u0441 \u0432\u0440\u0443\u0447\u043d\u0443\u044e:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">\/\/ \u043f\u043e\u0438\u0441\u043a \u043a\u0430\u043d\u0432\u0430\u0441\u0430 \u0441\u043a\u0440\u044b\u043b         \/\/private void TryFindCanvas()         \/\/{         \/\/    m_Canvas = m_CursorGraphic?.GetComponentInParent&lt;Canvas>();         \/\/}<\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c  \u043a\u0430\u043d\u0432\u0430\u0441 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u0435 (\u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u0442\u043e\u043c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c). \u0410 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e &#171;isUseGamePad&#187;, \u043e\u043d\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b\u0448\u043a\u0438 \u0438 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">        public Canvas m_Canvas; \/\/ Canvas that gives the motion range for the software cursor.                  \/\/\/ &lt;summary>         \/\/\/ \u0424\u043b\u0430\u0433 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043b\u0438 \u0433\u0435\u0439\u043f\u0430\u0434         \/\/\/ &lt;\/summary>         private bool isUseGamePad = false;<\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p>\u041f\u0440\u0438\u0432\u043e\u0434\u0438\u043c &#171;UpdateMotion()&#187;, \u0432\u043e\u0442 \u0432 \u0442\u0430\u043a\u043e\u0439 \u0432\u0438\u0434:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\"> private void UpdateMotion()         {             \/\/ \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u043b\u0430\u0433 \u0447\u0442\u043e \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f              isUseGamePad = true;              if (m_VirtualMouse == null)             {                 \/\/ \u0444\u043b\u0430\u0433 \u0447\u0442\u043e \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0443\u0435\u0442\u0441\u044f                  isUseGamePad = false;                 return;             }              \/\/ Read current stick value.             var stickAction = m_StickAction.action;             if (stickAction == null)             {                 \/\/ \u0444\u043b\u0430\u0433 \u0447\u0442\u043e \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f                  isUseGamePad = false;                 return;             }             var stickValue = stickAction.ReadValue&lt;Vector2>();             if (Mathf.Approximately(0, stickValue.x) &amp;&amp; Mathf.Approximately(0, stickValue.y))             {                 \/\/ Motion has stopped.                 m_LastTime = default;                 m_LastStickValue = default;                  \/\/ \u0444\u043b\u0430\u0433 \u0447\u0442\u043e \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f                  isUseGamePad = false;              }             else             {                 var currentTime = InputState.currentTime;                 if (Mathf.Approximately(0, m_LastStickValue.x) &amp;&amp; Mathf.Approximately(0, m_LastStickValue.y))                 {                     \/\/ Motion has started.                     m_LastTime = currentTime;                 }                  \/\/ Compute delta.                 var deltaTime = (float)(currentTime - m_LastTime);                 var delta = new Vector2(m_CursorSpeed * stickValue.x * deltaTime, m_CursorSpeed * stickValue.y * deltaTime);                  \/\/ Update position.                 var currentPosition = m_VirtualMouse.position.ReadValue();                 var newPosition = currentPosition + delta;                   \/\/\/\/REVIEW: for the hardware cursor, clamp to something else?                 \/\/ Clamp to canvas.                 \/\/if (m_Canvas != null)                 \/\/{                     \/\/ Clamp to canvas.                     var pixelRect = m_Canvas.pixelRect;                     newPosition.x = Mathf.Clamp(newPosition.x, pixelRect.xMin, pixelRect.xMax);                     newPosition.y = Mathf.Clamp(newPosition.y, pixelRect.yMin, pixelRect.yMax);                 \/\/}                  \/\/\/\/REVIEW: the fact we have no events on these means that actions won't have an event ID to go by; problem?                 InputState.Change(m_VirtualMouse.position, newPosition);                 InputState.Change(m_VirtualMouse.delta, delta);                  \/\/ \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u043c\u044b\u0448\u043a\u0430                 InputState.Change(virtualMouse.position, newPosition);                 InputState.Change(virtualMouse.delta, delta);                  \/\/ Update software cursor transform, if any.                 if (m_CursorTransform != null &amp;&amp;                     (m_CursorMode == CursorMode.SoftwareCursor ||                      (m_CursorMode == CursorMode.HardwareCursorIfAvailable &amp;&amp; m_SystemMouse == null)))                     m_CursorTransform.anchoredPosition = newPosition;                  m_LastStickValue = stickValue;                 m_LastTime = currentTime;                  \/\/ Update hardware cursor.                 m_SystemMouse?.WarpCursorPosition(newPosition);             }              \/\/ Update scroll wheel.             var scrollAction = m_ScrollWheelAction.action;             if (scrollAction != null)             {                                   var scrollValue = scrollAction.ReadValue&lt;Vector2>();                 \/\/Debug.Log(scrollValue.x + \"   \" + scrollValue.y);                 scrollValue.x *= m_ScrollSpeed;                 scrollValue.y *= m_ScrollSpeed;                   InputState.Change(m_VirtualMouse.scroll, scrollValue);                  \/\/ \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u043c \u043c\u044b\u0448\u043a\u0443 \u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0437\u0443\u043c\u043e\u043c, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0430\u0436\u0430\u0442\u0438\u044f                 if (scrollValue.y != 0)                 {                     \/\/ \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u043a\u0440\u043e\u043b\u043b \u0443 \u043c\u044b\u0448\u043a\u0438                      InputState.Change(Mouse.current.scroll, scrollValue);                 }             }                       }<\/code><\/pre>\n<ol start=\"6\">\n<li>\n<p>\u0414\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c &#171;OnAfterInputUpdate()&#187;:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">        private void OnAfterInputUpdate()         {             UpdateMotion();                          \/\/ \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430 \u0438\u0437 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043c\u044b\u0448\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u043d\u0435 \u0437\u0430\u0439\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d             if (isUseGamePad == false)             {                 InputState.Change(m_VirtualMouse.position, Mouse.current.position.ReadValue());             }         }<\/code><\/pre>\n<p>\u0412\u0441\u0451, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0447\u0438\u0439 VirtualMouse, \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 hardware. \u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u043a\u0443\u0440\u0441\u043e\u0440 \u0438 \u043d\u0430 \u043c\u044b\u0448\u043a\u0443 \u0438 \u043d\u0430 \u0433\u0435\u0439\u043c\u043f\u0430\u0434, \u0438 \u043e\u043d \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u044d\u043a\u0440\u0430\u043d\u0430. \u0422\u0430\u043a \u0436\u0435 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043b\u0435\u0441\u0438\u043a\u0430 \u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u043e\u043c, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 Mouse.current.scroll.ReadValue().y \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0442\u0430\u043c \u0438 \u0442\u0430\u043c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e. \u0422\u0435\u043f\u0435\u0440\u044c Unity \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u043a\u0430\u043a \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u043c\u044b\u0448\u044c.<\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u0432\u0430\u0439\u0441\u044b \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee7\/d77\/c92\/ee7d77c92987fb131d4749e1b7398329.PNG\" alt=\"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Input System Package\" title=\"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Input System Package\" width=\"618\" height=\"505\"\/><\/p>\n<div><figcaption>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Input System Package<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0443 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430 \u0434\u043b\u044f \u043a\u043e\u043b\u0435\u0441\u0438\u043a\u0430. \u0412\u0435\u0449\u044c \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430\u044f \u0438 \u043d\u0430 \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u0432\u0440\u0435\u043c\u044f:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3e9\/cb1\/4ec\/3e9cb14ec0a7b945bf0f9155f6dc2926.PNG\" alt=\"VirtualMouseV\" title=\"VirtualMouseV\" width=\"483\" height=\"162\"\/><\/p>\n<div><figcaption>VirtualMouseV<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f1b\/4a1\/dd4\/f1b4a1dd4fa81dd8b0dc7f3bc90fcc06.png\" alt=\"VirtualMouseV\" title=\"VirtualMouseV\" width=\"309\" height=\"136\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f1b\/4a1\/dd4\/f1b4a1dd4fa81dd8b0dc7f3bc90fcc06.png\"\/><\/p>\n<div><figcaption>VirtualMouseV<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/609\/239\/fa4\/609239fa4ae9e6db676fc2913ba40a2a.png\" alt=\"VirtualMouseV\" title=\"VirtualMouseV\" width=\"303\" height=\"145\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/609\/239\/fa4\/609239fa4ae9e6db676fc2913ba40a2a.png\"\/><\/p>\n<div><figcaption>VirtualMouseV<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043e\u043f\u0438\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u041a\u0443\u0440\u0441\u043e\u0440 \u0432 \u0440\u043e\u043b\u0438\u043a\u0435 \u0434\u0432\u0438\u0433\u0430\u0435\u0442 \u043c\u044b\u0448\u043a\u0430 \u0438 \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/644faa58cf7e13dfb3c5b955\" data-style=\"\" id=\"644faa58cf7e13dfb3c5b955\" width=\"\"><\/div>\n<p>\u041f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0441\u043b\u0443\u0447\u0430\u0435\u043c, <a href=\"https:\/\/store.steampowered.com\/app\/2324220\/VICCP_2_Core\/\" rel=\"noopener noreferrer nofollow\"><strong>\u0434\u0430\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0441\u0432\u043e\u044e \u0431\u0443\u0434\u0443\u0449\u0443\u044e \u0438\u0433\u0440\u0443 VICCP 2 Core<\/strong><\/a>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0434\u0435\u043b\u0430\u044e \u0432 \u043e\u0434\u0438\u043d\u043e\u0447\u043a\u0443. <\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0442\u0435\u043c, \u043a\u0442\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. <\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/733634\/\"> https:\/\/habr.com\/ru\/articles\/733634\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0430\u043a\u0435\u0442 Input System \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a\u0435<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0427\u0438\u0442\u0430\u044e \u0425\u0430\u0431\u0440 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0435\u0433\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f, \u043d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0442\u0430\u043b \u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0440\u0435\u0448\u0438\u043b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e. \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0412\u0435\u043d\u0438\u0430\u043c\u0438\u043d \u0410\u0444\u0430\u043d\u0430\u0441\u044c\u0435\u0432 \u0438 \u044f c\u043e\u043b\u043e \u0438\u043d\u0434\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0432 Unity. \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0441\u044c \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u0434\u0432\u0438\u0436\u043a\u0430 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c \u043a\u0430\u043a \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c VirtualMouse \u0438\u0437 \u043d\u043e\u0432\u043e\u0433\u043e Input System Unity \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p>\u0412 \u0441\u0432\u043e\u0435\u0439 \u043d\u043e\u0432\u043e\u0439 \u0438\u0433\u0440\u0435 VICCP-2 Core, \u044f \u0440\u0435\u0448\u0438\u043b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430 \u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b \u043d\u043e\u0432\u044b\u0439 Input System. \u041e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 \u043d\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0438 \u0432 <a href=\"https:\/\/docs.unity3d.com\/Packages\/com.unity.inputsystem@1.4\/api\/UnityEngine.InputSystem.UI.VirtualMouseInput.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u0431\u044b\u043b\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u044d\u0442\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0412 \u043f\u0430\u043a\u0435\u0442\u0435 \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0432\u044b\u0448\u0435).<\/p>\n<figure class=\"\">\n<div><figcaption>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Virtual Mouse<\/figcaption><\/div>\n<\/figure>\n<p>\u0423 \u043f\u0430\u043a\u0435\u0442\u0430 \u0435\u0441\u0442\u044c 2 \u0440\u0435\u0436\u0438\u043c\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0443\u0440\u0441\u043e\u0440\u0430: Hardware \u0438 Software. \u0418 \u0442\u0443\u0442 \u0436\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0443 \u043c\u044b\u0448\u043a\u0438 \u0438 \u0443 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430 \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u044b. \u041f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 Hardware \u043a\u0443\u0440\u0441\u043e\u0440\u0430, \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u0441 \u043c\u044b\u0448\u043a\u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0430\u043b\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0412 \u0434\u043e\u0432\u0435\u0441\u043e\u043a \u043f\u0440\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0441 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430  \u043a\u0443\u0440\u0441\u043e\u0440 \u0432\u044b\u0445\u043e\u0434\u0438\u043b \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u044d\u043a\u0440\u0430\u043d\u0430. \u0417\u0443\u043c \u043a\u043e\u043b\u0435\u0441\u0438\u043a\u0430 \u043d\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f. \u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441\u043b\u043e\u0436\u0438\u043b\u0430\u0441\u044c, \u0447\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. <\/p>\n<p>\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u044f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u0435\u0437 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041d\u0430\u0448\u0435\u043b \u043a\u0443\u0447\u0443 \u0444\u043e\u0440\u0443\u043c\u043e\u0432, \u0440\u043e\u043b\u0438\u043a\u043e\u0432 \u043d\u0430 \u044e\u0442\u0443\u0431\u0435 \u0433\u0434\u0435 \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u043e. \u041d\u043e \u043a \u043c\u043e\u0435\u043c\u0443 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u044e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0448\u0435\u043b, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043e\u0434\u043d\u043e\u0433\u043e <a href=\"https:\/\/www.youtube.com\/watch?v=Y3WNwl1ObC8&amp;t=1293s\" rel=\"noopener noreferrer nofollow\">\u0440\u043e\u043b\u0438\u043a\u0430<\/a>, \u043d\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043c\u0435\u043d\u044f \u043d\u0435 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u043b. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u043f\u0430\u043a\u0435\u0442 \u0441\u0442\u0430\u0432\u0438\u0442 1.3.0 \u0432\u0435\u0440\u0441\u0438\u044e, \u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0435\u0441\u0442\u044c \u0443\u0436\u0435 \u043d\u0430 1.5.1. \u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0433\u0438\u0442\u0445\u0430\u0431 \u043e\u0442 Unity \u0438 \u0431\u0435\u0437 \u0442\u0440\u0443\u0434\u0430 \u043d\u0430\u0448\u0435\u043b \u0442\u0430\u043c \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043c\u043d\u0435 <a href=\"https:\/\/github.com\/Unity-Technologies\/InputSystem\/blob\/develop\/Packages\/com.unity.inputsystem\/InputSystem\/Plugins\/UI\/VirtualMouseInput.cs\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430<\/a>. \u0418 \u0442\u0430\u043c \u044f \u0443\u0432\u0438\u0434\u0435\u043b \u044d\u0442\u043e:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>TO DO 2023<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0430\u0437\u043d\u0438\u0446\u044b \u0443 \u0444\u0430\u0439\u043b\u0430 \u0438\u0437 2019 \u0438 \u0444\u0430\u0439\u043b\u0430 2023 \u0432\u0435\u0440\u0441\u0438\u0438 1.5.1 \u043d\u0435\u0442. \u0417\u0430 3 \u0433\u043e\u0434\u0430, \u0432\u0441\u0435 \u044d\u0442\u0438 &#171;TODO&#187; \u0442\u0430\u043a \u0438 \u043d\u0435 \u0431\u044b\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b (\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 Unity, \u043d\u043e \u0441\u0430\u043c \u0434\u0432\u0438\u0436\u043e\u043a \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439).<\/p>\n<figure class=\"full-width\">\n<div><figcaption>TO DO 2019<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043b\u0430 \u0431\u0435\u0437\u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 &#171;\u0438\u043d\u043f\u0443\u0442 \u0441\u0438\u0441\u0442\u0435\u043c&#187;, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u0442\u043e\u043c \u043a\u0430\u043a\u0438\u0445 \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0417\u0430\u0442\u0435\u043c, \u044f \u043f\u043e\u043b\u0435\u0437 \u043d\u0430 \u0430\u0441\u0441\u0435\u0442\u0441\u0442\u043e\u0440, \u0438 \u043d\u0430\u0448\u0435\u043b \u0442\u0430\u043c \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0430\u0441\u0441\u0435\u0442 <a href=\"https:\/\/assetstore.unity.com\/packages\/tools\/utilities\/rewired-21676\" rel=\"noopener noreferrer nofollow\">Rewired<\/a>. \u0422\u0443\u0442 \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0435\u0433\u043e, \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u0441\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442, \u0438\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0435\u043c\u0443. \u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0440\u043e\u0434\u043d\u043e\u0439 VirtualMouse \u043e\u0442 Unity \u043d\u0435\u0442. \u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043b, \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u043e\u0438\u0441\u043a\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043e\u043f\u044b\u0442 \u0438 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u043b\u044e\u0434\u0438 \u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u0441\u0442\u0443\u043f\u043e\u0440 \u0438 \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431 Unity, \u043c\u043e\u0436\u0435\u0442 \u0441\u043f\u0430\u0441\u0442\u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e\u0442 \u043e \u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0438. \u0414\u0432\u0438\u0436\u043e\u043a \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0447\u0430\u0441\u0442\u043e \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435. \u0410 \u0435\u0449\u0451 \u043c\u043d\u0435 \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0437\u0430\u0431\u0430\u0432\u043d\u043e\u0439, \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442. <\/p>\n<p>\u042f \u043d\u0435 \u0433\u043e\u0440\u0435\u043b \u0436\u0435\u043b\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u044c \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u0430\u0441\u0441\u0435\u0442 \u0438 \u0436\u0430\u0431\u0430 \u043c\u0435\u043d\u044f \u0442\u0430\u043a \u0437\u0430\u0434\u0430\u0432\u0438\u043b\u0430, \u0447\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u044f \u0440\u0435\u0448\u0438\u043b \u0437\u0430\u043b\u0435\u0437\u0442\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u0438 \u0434\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0438 &#171;TODO&#187; \u0441\u0430\u043c. \u0422\u0430\u043a \u0436\u0435 \u0432\u043b\u0435\u0437\u0442\u044c \u0432 \u043a\u043e\u0434 Unity, \u0443\u0436\u0435 \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0439 \u0447\u0435\u043b\u043b\u0435\u043d\u0434\u0436. \u0418\u0442\u0430\u043a \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c:<\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u0440\u0435\u0437\u0430\u0435\u043c \u0432\u0435\u0441\u044c \u043a\u043b\u0430\u0441\u0441 \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439, \u0442\u0430\u043a \u0436\u0435 \u043c\u0435\u043d\u044f\u0435\u043c \u0438\u043c\u044f \u043d\u0430 &#171;VirtualMouseV&#187;. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u043b\u0438 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0438 \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">public class VirtualMouseV : MonoBehaviour<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0422\u0443\u0442 \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0443 &#171;InputSystem.DisableDevice(m_SystemMouse);&#187;. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430, \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u043b\u0430 \u043c\u044b\u0448\u043a\u0443 (\u0417\u0430\u0447\u0435\u043c?):<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">private void TryEnableHardwareCursor()         {             var devices = InputSystem.devices;             for (var i = 0; i &lt; devices.Count; ++i)             {                 var device = devices[i];                 if (device.native &amp;&amp; device is Mouse mouse)                 {                     m_SystemMouse = mouse;                     break;                 }             }              if (m_SystemMouse == null)             {                 if (m_CursorGraphic != null)                     m_CursorGraphic.enabled = true;                 return;             }              \/\/ \u0443\u0431\u0440\u0430\u043b \u0447\u0442\u043e\u0431\u044b \u043c\u044b\u0448\u043a\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c             \/\/ InputSystem.DisableDevice(m_SystemMouse);              \/\/ Sync position.             if (m_VirtualMouse != null)                 m_SystemMouse.WarpCursorPosition(m_VirtualMouse.position.ReadValue());              \/\/ Turn off mouse cursor image.             if (m_CursorGraphic != null)                 m_CursorGraphic.enabled = false;         }<\/code><\/pre>\n<ol start=\"3\">\n<li>\n<p>\u0423\u0431\u0438\u0440\u0430\u0435\u043c &#171;TryFindCanvas()&#187;. \u0411\u0443\u0434\u0435\u043c \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u043d\u0432\u0430\u0441 \u0432\u0440\u0443\u0447\u043d\u0443\u044e:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">\/\/ \u043f\u043e\u0438\u0441\u043a \u043a\u0430\u043d\u0432\u0430\u0441\u0430 \u0441\u043a\u0440\u044b\u043b         \/\/private void TryFindCanvas()         \/\/{         \/\/    m_Canvas = m_CursorGraphic?.GetComponentInParent&lt;Canvas>();         \/\/}<\/code><\/pre>\n<ol start=\"4\">\n<li>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c  \u043a\u0430\u043d\u0432\u0430\u0441 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u0435 (\u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u0442\u043e\u043c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c). \u0410 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e &#171;isUseGamePad&#187;, \u043e\u043d\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b\u0448\u043a\u0438 \u0438 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">        public Canvas m_Canvas; \/\/ Canvas that gives the motion range for the software cursor.                  \/\/\/ &lt;summary>         \/\/\/ \u0424\u043b\u0430\u0433 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043b\u0438 \u0433\u0435\u0439\u043f\u0430\u0434         \/\/\/ &lt;\/summary>         private bool isUseGamePad = false;<\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p>\u041f\u0440\u0438\u0432\u043e\u0434\u0438\u043c &#171;UpdateMotion()&#187;, \u0432\u043e\u0442 \u0432 \u0442\u0430\u043a\u043e\u0439 \u0432\u0438\u0434:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\"> private void UpdateMotion()         {             \/\/ \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u043b\u0430\u0433 \u0447\u0442\u043e \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f              isUseGamePad = true;              if (m_VirtualMouse == null)             {                 \/\/ \u0444\u043b\u0430\u0433 \u0447\u0442\u043e \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0443\u0435\u0442\u0441\u044f                  isUseGamePad = false;                 return;             }              \/\/ Read current stick value.             var stickAction = m_StickAction.action;             if (stickAction == null)             {                 \/\/ \u0444\u043b\u0430\u0433 \u0447\u0442\u043e \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f                  isUseGamePad = false;                 return;             }             var stickValue = stickAction.ReadValue&lt;Vector2>();             if (Mathf.Approximately(0, stickValue.x) &amp;&amp; Mathf.Approximately(0, stickValue.y))             {                 \/\/ Motion has stopped.                 m_LastTime = default;                 m_LastStickValue = default;                  \/\/ \u0444\u043b\u0430\u0433 \u0447\u0442\u043e \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f                  isUseGamePad = false;              }             else             {                 var currentTime = InputState.currentTime;                 if (Mathf.Approximately(0, m_LastStickValue.x) &amp;&amp; Mathf.Approximately(0, m_LastStickValue.y))                 {                     \/\/ Motion has started.                     m_LastTime = currentTime;                 }                  \/\/ Compute delta.                 var deltaTime = (float)(currentTime - m_LastTime);                 var delta = new Vector2(m_CursorSpeed * stickValue.x * deltaTime, m_CursorSpeed * stickValue.y * deltaTime);                  \/\/ Update position.                 var currentPosition = m_VirtualMouse.position.ReadValue();                 var newPosition = currentPosition + delta;                   \/\/\/\/REVIEW: for the hardware cursor, clamp to something else?                 \/\/ Clamp to canvas.                 \/\/if (m_Canvas != null)                 \/\/{                     \/\/ Clamp to canvas.                     var pixelRect = m_Canvas.pixelRect;                     newPosition.x = Mathf.Clamp(newPosition.x, pixelRect.xMin, pixelRect.xMax);                     newPosition.y = Mathf.Clamp(newPosition.y, pixelRect.yMin, pixelRect.yMax);                 \/\/}                  \/\/\/\/REVIEW: the fact we have no events on these means that actions won't have an event ID to go by; problem?                 InputState.Change(m_VirtualMouse.position, newPosition);                 InputState.Change(m_VirtualMouse.delta, delta);                  \/\/ \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u043c\u044b\u0448\u043a\u0430                 InputState.Change(virtualMouse.position, newPosition);                 InputState.Change(virtualMouse.delta, delta);                  \/\/ Update software cursor transform, if any.                 if (m_CursorTransform != null &amp;&amp;                     (m_CursorMode == CursorMode.SoftwareCursor ||                      (m_CursorMode == CursorMode.HardwareCursorIfAvailable &amp;&amp; m_SystemMouse == null)))                     m_CursorTransform.anchoredPosition = newPosition;                  m_LastStickValue = stickValue;                 m_LastTime = currentTime;                  \/\/ Update hardware cursor.                 m_SystemMouse?.WarpCursorPosition(newPosition);             }              \/\/ Update scroll wheel.             var scrollAction = m_ScrollWheelAction.action;             if (scrollAction != null)             {                                   var scrollValue = scrollAction.ReadValue&lt;Vector2>();                 \/\/Debug.Log(scrollValue.x + \"   \" + scrollValue.y);                 scrollValue.x *= m_ScrollSpeed;                 scrollValue.y *= m_ScrollSpeed;                   InputState.Change(m_VirtualMouse.scroll, scrollValue);                  \/\/ \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u043c \u043c\u044b\u0448\u043a\u0443 \u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0437\u0443\u043c\u043e\u043c, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0430\u0436\u0430\u0442\u0438\u044f                 if (scrollValue.y != 0)                 {                     \/\/ \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u043a\u0440\u043e\u043b\u043b \u0443 \u043c\u044b\u0448\u043a\u0438                      InputState.Change(Mouse.current.scroll, scrollValue);                 }             }                       }<\/code><\/pre>\n<ol start=\"6\">\n<li>\n<p>\u0414\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c &#171;OnAfterInputUpdate()&#187;:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">        private void OnAfterInputUpdate()         {             UpdateMotion();                          \/\/ \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430 \u0438\u0437 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043c\u044b\u0448\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u043d\u0435 \u0437\u0430\u0439\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d             if (isUseGamePad == false)             {                 InputState.Change(m_VirtualMouse.position, Mouse.current.position.ReadValue());             }         }<\/code><\/pre>\n<p>\u0412\u0441\u0451, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0447\u0438\u0439 VirtualMouse, \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 hardware. \u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u043a\u0443\u0440\u0441\u043e\u0440 \u0438 \u043d\u0430 \u043c\u044b\u0448\u043a\u0443 \u0438 \u043d\u0430 \u0433\u0435\u0439\u043c\u043f\u0430\u0434, \u0438 \u043e\u043d \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u044d\u043a\u0440\u0430\u043d\u0430. \u0422\u0430\u043a \u0436\u0435 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043b\u0435\u0441\u0438\u043a\u0430 \u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u043e\u043c, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 Mouse.current.scroll.ReadValue().y \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0442\u0430\u043c \u0438 \u0442\u0430\u043c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e. \u0422\u0435\u043f\u0435\u0440\u044c Unity \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u043a\u0430\u043a \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u043c\u044b\u0448\u044c.<\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u0432\u0430\u0439\u0441\u044b \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u0430:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Input System Package<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0443 \u0433\u0435\u0439\u043c\u043f\u0430\u0434\u0430 \u0434\u043b\u044f \u043a\u043e\u043b\u0435\u0441\u0438\u043a\u0430. \u0412\u0435\u0449\u044c \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430\u044f \u0438 \u043d\u0430 \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u0432\u0440\u0435\u043c\u044f:<\/p>\n<figure class=\"\">\n<div><figcaption>VirtualMouseV<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\">\n<div><figcaption>VirtualMouseV<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\">\n<div><figcaption>VirtualMouseV<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043e\u043f\u0438\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u041a\u0443\u0440\u0441\u043e\u0440 \u0432 \u0440\u043e\u043b\u0438\u043a\u0435 \u0434\u0432\u0438\u0433\u0430\u0435\u0442 \u043c\u044b\u0448\u043a\u0430 \u0438 \u0433\u0435\u0439\u043c\u043f\u0430\u0434 \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/644faa58cf7e13dfb3c5b955\" data-style=\"\" id=\"644faa58cf7e13dfb3c5b955\" width=\"\"><\/div>\n<p>\u041f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0441\u043b\u0443\u0447\u0430\u0435\u043c, <a href=\"https:\/\/store.steampowered.com\/app\/2324220\/VICCP_2_Core\/\" rel=\"noopener noreferrer nofollow\"><strong>\u0434\u0430\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0441\u0432\u043e\u044e \u0431\u0443\u0434\u0443\u0449\u0443\u044e \u0438\u0433\u0440\u0443 VICCP 2 Core<\/strong><\/a>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0434\u0435\u043b\u0430\u044e \u0432 \u043e\u0434\u0438\u043d\u043e\u0447\u043a\u0443. <\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0442\u0435\u043c, \u043a\u0442\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. <\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!-<\/div>\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-410967","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/410967","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=410967"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/410967\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=410967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=410967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=410967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}