{"id":472255,"date":"2025-08-26T15:02:45","date_gmt":"2025-08-26T15:02:45","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=472255"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=472255","title":{"rendered":"<span>\u041a\u043e\u043f\u0430\u0435\u043c\u0441\u044f \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 Unity VR \u0438\u0433\u0440. \u0427\u0430\u0441\u0442\u044c 2: NorthStar<\/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<p>\u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0438\u0437 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430, \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0443 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u043c\u0438 VR-\u0438\u0433\u0440\u0430\u043c\u0438, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0438 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio. \u0417\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c, NorthStar!<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/cce\/361\/3ee\/cce3613eec8ee84ad4bb2e0e6ee2fe43.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/cce\/361\/3ee\/cce3613eec8ee84ad4bb2e0e6ee2fe43.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/cce\/361\/3ee\/cce3613eec8ee84ad4bb2e0e6ee2fe43.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u041e\u0431 \u0438\u0433\u0440\u0435<\/h3>\n<p><a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\" rel=\"noopener noreferrer nofollow\">NorthStar<\/a> \u2014 \u044d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043d\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043a\u0440\u0430\u0441\u0438\u0432\u0430\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0438\u0433\u0440\u0430, \u0433\u0434\u0435 \u0432\u044b \u043f\u0440\u0438\u043c\u0438\u0442\u0435 \u043d\u0430 \u0441\u0435\u0431\u044f \u0440\u043e\u043b\u044c \u043f\u043e\u0442\u0435\u0440\u043f\u0435\u0432\u0448\u0435\u0433\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u043a\u0440\u0443\u0448\u0435\u043d\u0438\u0435, \u0447\u0443\u0434\u043e\u043c \u0441\u043f\u0430\u0441\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044f Polaris, \u0447\u0430\u0441\u0442\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u043c \u0441\u0443\u0436\u0434\u0435\u043d\u043e \u0441\u0442\u0430\u0442\u044c.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/916\/3df\/b07\/9163dfb0776f161afdec7d804463590a.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/916\/3df\/b07\/9163dfb0776f161afdec7d804463590a.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/916\/3df\/b07\/9163dfb0776f161afdec7d804463590a.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 (\u043e\u0434\u0438\u043d \u043e\u043a\u0435\u0430\u043d \u0447\u0435\u0433\u043e \u0441\u0442\u043e\u0438\u0442), \u0438\u0433\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043e\u043c \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u044f.<\/p>\n<p>\u0412\u0435\u0440\u0451\u0432\u043a\u0438, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043c\u0430\u0442\u044b\u0432\u0430\u0442\u044c, \u0440\u0430\u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0438 \u0442\u043e\u043b\u043a\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/971\/355\/fa6\/971355fa63b9d8c189ac42b03ec2d8f9.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/971\/355\/fa6\/971355fa63b9d8c189ac42b03ec2d8f9.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/971\/355\/fa6\/971355fa63b9d8c189ac42b03ec2d8f9.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u043e\u0434\u0437\u043e\u0440\u043d\u0430\u044f \u0442\u0440\u0443\u0431\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u043b\u0435\u043a\u043e.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/c22\/37f\/b6e\/c2237fb6e3bfe4fb29cf8fbee4992580.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/c22\/37f\/b6e\/c2237fb6e3bfe4fb29cf8fbee4992580.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/c22\/37f\/b6e\/c2237fb6e3bfe4fb29cf8fbee4992580.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0413\u0430\u0440\u043f\u0443\u043d\u043d\u043e\u0435 \u0440\u0443\u0436\u044c\u0451 \u0441 \u0440\u0443\u0447\u043d\u044b\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c: \u0437\u0430\u0440\u044f\u0434\u043a\u0430 \u0431\u043e\u043b\u0442\u0430, \u043d\u0430\u0442\u044f\u0433\u0438\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u0442\u0438\u0432\u044b, \u043f\u0440\u0438\u0446\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0443\u0442\u0435\u043c \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0433\u0430\u0440\u043f\u0443\u043d\u0430 \u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/5f5\/ca8\/5ff\/5f5ca85ff0e6eb8790a993dbdc4abde9.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/5f5\/ca8\/5ff\/5f5ca85ff0e6eb8790a993dbdc4abde9.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/5f5\/ca8\/5ff\/5f5ca85ff0e6eb8790a993dbdc4abde9.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u043e\u043f\u0430\u043b\u0438 \u0433\u0430\u0440\u043f\u0443\u043d\u043e\u043c \u0432\u043e \u0447\u0442\u043e-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435? \u041f\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u0435 \u0440\u0443\u043a\u043e\u044f\u0442\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u043a\u043e\u0440\u0430\u0431\u043b\u044c.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/b12\/d79\/a0e\/b12d79a0e68c913d1231096f9ae64cbd.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/b12\/d79\/a0e\/b12d79a0e68c913d1231096f9ae64cbd.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/b12\/d79\/a0e\/b12d79a0e68c913d1231096f9ae64cbd.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u0438\u0433\u0440\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0438, \u043a\u0430\u043a \u0441\u043c\u0435\u043d\u0430 \u0434\u043d\u044f \u0438 \u043d\u043e\u0447\u0438, \u0441\u043c\u0435\u043d\u0430 \u043f\u043e\u0433\u043e\u0434\u044b, \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u044f, NPC.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0431\u0443\u0434\u0438\u043b\u043e \u043c\u0435\u043d\u044f \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0438\u0433\u0440\u043e\u0439 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u044f, \u043d\u043e \u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u0438\u0441\u043f\u044b\u0442\u0430\u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio.<\/p>\n<h3>\u041e PVS-Studio<\/h3>\n<p>\u041d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0438 \u043d\u0435 \u0447\u0438\u0442\u0430\u043b\u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1278\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/a> \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438.<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u043a\u043e\u0434\u0435 C#, C++, C \u0438 Java \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>PVS-Studio \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438, \u0442\u0430\u043a \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u043c\u0435\u043d\u043d\u043e Unity-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, PVS-Studio \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0443 Unity-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0438\u0445 \u043a\u043e\u0434. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0435 \u0435\u0441\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 API \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d UnityEngine, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 API. \u042d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a, \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u0434\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0434\u043b\u044f Unity-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438, \u0432\u044b\u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439 \u0432 \u0431\u043b\u043e\u043a\u0430\u0445 \u0442\u0430\u043a\u0438\u0445 \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u0430\u043a <code>Update<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u0443\u0447\u0451\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e\/\u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e Unity-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0441 <code>null<\/code>. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0442\u0430\u043a\u0436\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0438\u0433\u0440\u0435, \u0447\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c null-\u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043e\u0431 \u044d\u0442\u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/0744\/\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u0441\u0442\u0430\u043b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043d\u0430 Unity<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1236\/\" rel=\"noopener noreferrer nofollow\">PVS-Studio \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 Unity: \u043d\u043e\u0432\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0441\u0442\u043e. \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0442\u0440\u0451\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0448\u0430\u0433\u0430\u043c:<\/p>\n<p>1. \u0417\u0430\u043f\u0443\u0441\u043a \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438\u043b\u0438 \u0432\u0441\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u0438\u043a\u043e\u043c;<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/ae2\/53c\/54d\/ae253c54d257130f799eab86bdd0eb2f.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/ae2\/53c\/54d\/ae253c54d257130f799eab86bdd0eb2f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/ae2\/53c\/54d\/ae253c54d257130f799eab86bdd0eb2f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>2. \u041e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u044b\u0445 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043d\u0435\u043b\u0438 \u0438\u043b\u0438 \u0436\u0435 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430;<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/ab5\/85a\/e71\/ab585ae71b5294d83bc769c672f7cd76.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/ab5\/85a\/e71\/ab585ae71b5294d83bc769c672f7cd76.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/ab5\/85a\/e71\/ab585ae71b5294d83bc769c672f7cd76.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>3. \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439. \u041f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u0434\u043e\u0432\u044b\u0445 \u0431\u0430\u0437 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0442\u0440\u0443\u0434\u043e\u0451\u043c\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u043d\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u043e\u0433\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/0032\/\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/a> \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/52e\/ba1\/0df\/52eba10dfba9548b86d1842c9439530a.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/52e\/ba1\/0df\/52eba10dfba9548b86d1842c9439530a.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/52e\/ba1\/0df\/52eba10dfba9548b86d1842c9439530a.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u043a\u043b\u0430\u0434\u043a\u0430 <strong>Best warnings<\/strong>. \u0412 \u043d\u0435\u0439 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0433\u0443\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/524\/945\/633\/524945633720c820479c583c5dfaec52.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/524\/945\/633\/524945633720c820479c583c5dfaec52.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/524\/945\/633\/524945633720c820479c583c5dfaec52.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f Visual Studio, \u043d\u043e PVS-Studio \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 IDE \u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a Rider \u0438 Visual Studio Code. \u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/0018\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0430\u0439\u0442\u0435<\/a>.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 PVS-Studio \u0432 \u0434\u0435\u043b\u0435?<\/p>\n<h3>O \u043a\u043e\u0434\u0435<\/h3>\n<p>\u041a\u0430\u043a \u0438 \u0432 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1278\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>, \u043e\u0448\u0438\u0431\u043e\u043a \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0431\u044b\u043b\u0438 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445, \u043d\u043e \u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0433\u0440\u044b \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f. \u041d\u0438\u0436\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0430\u043c\u044b\u0435 \u044f\u0432\u043d\u044b\u0435 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445. \u041f\u043e\u0433\u043d\u0430\u043b\u0438!<\/p>\n<h4>\u041f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043f\u043e \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443<\/h4>\n<pre><code class=\"cs\">public void Skip() {   ....   var currTaskIndex = Task.Sequence                           .TaskDefinitions                           .FindIndex(def =&gt; def.ID == TaskID);    if (currTaskIndex != 0)   {     var lastTask = Task.Sequence.TaskDefinitions[currTaskIndex - 1];     ....   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3106\/\" rel=\"noopener noreferrer nofollow\">V3106<\/a> [CWE-125] Possible negative index value. The value of &#8216;currTaskIndex &#8212; 1&#8217; index could reach -2. <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Packages\/com.meta.utilities.narrative\/Runtime\/NarrativeSequence\/TaskHandler.cs#L201\" rel=\"noopener noreferrer nofollow\">TaskHandler.cs 201<\/a><\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u043c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043f\u043e \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443. \u041a\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e; \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 <code>currTaskIndex != 0<\/code> \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u044b\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 <code>-1<\/code>, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u043b\u043e \u0431\u044b \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<h4>\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435 \u0436\u0434\u0430\u043b\u0438<\/h4>\n<pre><code class=\"cs\">public void CollisionPass(....) {   ....   if (!CachedSphereCollider.TryGet(out var sphereCollider)) \/\/ &lt;=   {     return;   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\" rel=\"noopener noreferrer nofollow\">V3022<\/a> [CWE-570] Expression &#8216;!CachedSphereCollider.TryGet(out var sphereCollider)&#8217; is always false. <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Assets\/NorthStar\/Animation\/AnimationScripts\/NPC_DynamicRigs.cs#L522\" rel=\"noopener noreferrer nofollow\">NPC_DynamicRigs.cs 522<\/a><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <code>CachedSphereCollider.TryGet<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2014 <code>true<\/code>. \u0422\u0430\u043a \u043b\u0438 \u044d\u0442\u043e? \u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"cs\">public static bool TryGet(out SphereCollider collider) {   if (s_hasSphere)   {     collider = s_sphereCollider;     return true;   }    try   {     ....     s_sphereCollider = obj.GetComponent&lt;SphereCollider&gt;();     collider = s_sphereCollider;     collider.enabled = false;     s_hasSphere = true;     return true;   }   catch   {     ....     throw;   } } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a. \u041e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u041f\u043e \u0438\u0434\u0435\u0435, \u043c\u0435\u0442\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <code>true<\/code> \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 <code>sphereCollider<\/code> \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043c \u0438\u043b\u0438 \u0438\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0438 <code>false<\/code> \u2014 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u041d\u0430 \u0434\u0435\u043b\u0435 \u0436\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043f\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>sphereCollider<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c, \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0431\u0435\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0441\u0442\u0435\u043a\u0443 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <code>CollisionPass<\/code> \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u0442\u043e\u0447\u0435\u043a \u0432\u0445\u043e\u0434\u0430, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <code>LateUpdate<\/code>, \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<h4>\u041f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 null-\u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435<\/h4>\n<pre><code class=\"cs\">private void DisplayResults() {   if (m_texturesWithoutMipmaps.Count &gt; 0)   {     ....   }   else if (m_texturesWithoutMipmaps != null)   {     ....   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3095\/\" rel=\"noopener noreferrer nofollow\">V3095<\/a> [CWE-476] The &#8216;m_texturesWithoutMipmaps&#8217; object was used before it was verified against null. Check lines: 91, 128. <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Assets\/NorthStar\/Editor\/MipMapChecker.cs#L91\" rel=\"noopener noreferrer nofollow\">MipMapChecker.cs 91<\/a><\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 null-\u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 <code>if<\/code>. \u041d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e <code>else if<\/code>. \u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u0430 \u043f\u043e\u0442\u043e\u043c \u0443\u0436\u0435 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0441 <code>null<\/code> \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0439. \u041d\u043e \u0432\u0441\u0451 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c, \u0441\u0442\u043e\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u0435\u0440\u0432\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 <code>?.<\/code>:<\/p>\n<pre><code class=\"cs\">private void DisplayResults() {   if (m_texturesWithoutMipmaps?.Count &gt; 0)   {     ....   }   else if (m_texturesWithoutMipmaps != null)   {     ....   } } <\/code><\/pre>\n<h4>\u041d\u0435\u043d\u0430\u0434\u0451\u0436\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 null<\/h4>\n<pre><code class=\"cs\">public class FadeVolume : MonoBehaviour {   [SerializeField] private AudioSource m_audioSource;   ....   public void FadeOutAudio(float time)   {     if (m_audioSource is null)     {       ....     }     ....   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3216\/\" rel=\"noopener noreferrer nofollow\">V3216<\/a> [CWE-754] Unity Engine. Checking the &#8216;m_audioSource&#8217; field with a specific Unity Engine type for null with &#8216;is&#8217; may not work correctly due to implicit field initialization by the engine. <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Assets\/NorthStar\/Scripts\/Vfx-Sfx\/FadeVolume.cs#L25\" rel=\"noopener noreferrer nofollow\">FadeVolume.cs 25<\/a><\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0435 \u043e\u043f\u0430\u0441\u043d\u0430 \u0432 Release \u0441\u0431\u043e\u0440\u043a\u0435 \u0438\u0433\u0440\u044b, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u043c \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 Unity. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0432 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u0435 \u043f\u043e\u043b\u044f \u0441 \u0442\u0438\u043f\u043e\u043c <code>UnityEngine.Object<\/code> \u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u043c \u043e\u0442 \u043d\u0435\u0433\u043e (\u043a\u0440\u043e\u043c\u0435 <code>MonoBehaviour<\/code> \u0438 <code>ScriptableObject<\/code>) \u043d\u0435\u044f\u0432\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c-\u043f\u0443\u0441\u0442\u044b\u0448\u043a\u043e\u0439, \u0435\u0441\u043b\u0438 \u043d\u0438 \u0432 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u0435, \u043d\u0438 \u0432 \u043a\u043e\u0434\u0435 \u044d\u0442\u0438 \u043f\u043e\u043b\u044f \u043d\u0435 \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0442\u043b\u0430\u0434\u043a\u0438, \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u044d\u0442\u043e:<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/373\/657\/7fc\/3736577fcecceaa79706220e5e5f6e7f.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/373\/657\/7fc\/3736577fcecceaa79706220e5e5f6e7f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/373\/657\/7fc\/3736577fcecceaa79706220e5e5f6e7f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043d\u0435\u044f\u0432\u043d\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 null, \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 <code>??<\/code>, <code>??=<\/code>, <code>?.<\/code>,  <code>is null<\/code> \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b, \u0442.\u043a. \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443 \u043f\u043e\u043b\u044f \u0435\u0441\u0442\u044c. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043d\u0430 <code>null<\/code> \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b <code>==<\/code>, <code>!=<\/code> \u0438\u043b\u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 <code>m_audioSource<\/code>, <code>!m_audioSource<\/code>, \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<h4>\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0446\u0438\u043a\u043b<\/h4>\n<pre><code class=\"cs\">string MemberLabel(string memberName) {   foreach (var memberInfo in currObject.GetType().GetMember(memberName))   {     if (....)     {       memberName = $\"{memberName}()\";     }      return $\"{memberInfo.DeclaringType?.Name}.{memberName}\";   }    return memberName; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3020\/\" rel=\"noopener noreferrer nofollow\">V3020<\/a> [CWE-670] An unconditional &#8216;return&#8217; within a loop. <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Packages\/com.meta.utilities.narrative\/Editor\/MemberLinkDrawer.cs#L162\" rel=\"noopener noreferrer nofollow\">MemberLinkDrawer.cs 162<\/a><\/p>\n<p>\u0421\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u0442 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443 \u043d\u0435\u0433\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f \u0438\u0437-\u0437\u0430 \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e <code>return<\/code> \u0432 \u0442\u0435\u043b\u0435. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e\u0442 <code>return<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0431\u043b\u043e\u043a\u0435 <code>if<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0431\u044b \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u0435\u0435:<\/p>\n<pre><code class=\"cs\">string MemberLabel(string memberName) {   foreach (var memberInfo in currObject.GetType().GetMember(memberName))   {     if (....)     {       memberName = $\"{memberName}()\";       return $\"{memberInfo.DeclaringType?.Name}.{memberName}\";     }   }    return memberName; } <\/code><\/pre>\n<h4>\u041e\u043f\u0435\u0447\u0430\u0442\u043a\u0438<\/h4>\n<p><strong>Issue 1<\/strong><\/p>\n<pre><code class=\"cs\">[Serializable] public struct ComfortPreset {   public float BoatMovementStrength;   public float BoatReactionStrength; } public void ComfortLevelChanged() {   OnComfortLevelChanged?.Invoke(PlayerConfigs.ComfortLevel);   var comfortPreset = ComfortPresets[(int)ComfortLevel];   BoatMovementStrength = comfortPreset.BoatMovementStrength;   BoatReactionStrength = comfortPreset.BoatMovementStrength; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3127\/\" rel=\"noopener noreferrer nofollow\">V3127<\/a> [CWE-682] Two similar code fragments were found. Perhaps, this is a typo and &#8216;BoatReactionStrength&#8217; variable should be used instead of &#8216;BoatMovementStrength&#8217; <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Assets\/NorthStar\/Scripts\/System\/GlobalSettings.cs#L70\" rel=\"noopener noreferrer nofollow\">GlobalSettings.cs 70<\/a>.<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u044f\u0432\u043d\u0443\u044e \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0443: \u043f\u043e\u043b\u044e <code>BoatReactionStrength<\/code> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u042d\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0432\u0435\u0434\u044c \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 <code>ComfortPreset<\/code> \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e. \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">public void ComfortLevelChanged() {   ....   BoatMovementStrength = comfortPreset.BoatMovementStrength;   BoatReactionStrength = comfortPreset.BoatReactionStrength; } <\/code><\/pre>\n<p><strong>Issue 2<\/strong><\/p>\n<pre><code class=\"cs\">public void OffsetVerlet(Vector3 offset) {   m_previousFrame = new Frame   {     Position = m_previousFrame.Position + offset,     Time = m_previousFrame.Time,   };   m_currentFrame = new Frame   {     Position = m_currentFrame.Position + offset,     Time = m_previousFrame.Time,   }; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3127\/\" rel=\"noopener noreferrer nofollow\">V3127<\/a> [CWE-682] Two similar code fragments were found. Perhaps, this is a typo and &#8216;m_currentFrame&#8217; variable should be used instead of &#8216;m_previousFrame&#8217; <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Assets\/NorthStar\/Animation\/AnimationScripts\/NPC_DynamicRigs.cs#L868\" rel=\"noopener noreferrer nofollow\">NPC_DynamicRigs.cs 868<\/a><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043e\u0431\u0449\u0438\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 <code>m_previousFrame<\/code> \u0438 <code>m_currentFrame<\/code>. \u041d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043e\u043d \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442\u0441\u044f: \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 <code>Time<\/code> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>m_previousFrame.Time<\/code>. \u041e\u0447\u0435\u043d\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>m_currentFrame<\/code> \u044d\u0442\u043e \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0443, \u0438 \u0432\u043c\u0435\u0441\u0442\u043e <code>m_previousFrame.Time<\/code> \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e <code>m_currentFrame.Time<\/code>.<\/p>\n<p><strong>Issue 3<\/strong><\/p>\n<pre><code class=\"cs\">public class DepthNormalOnlyPass : ScriptableRenderPass {   ....   internal void Render(RenderGraph renderGraph,      out TextureHandle cameraNormalsTexture,      out TextureHandle cameraDepthTexture,      ref RenderingData renderingData)   {     ....   }   .... }  private void OnMainRendering(....) {   ....   m_DepthNormalPrepass.Render(renderGraph,      out frameResources.cameraDepthTexture,      out frameResources.cameraNormalsTexture,      ref renderingData);   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3066\/\" rel=\"noopener noreferrer nofollow\">V3066<\/a> [CWE-683] Possible incorrect order of arguments passed to &#8216;Render&#8217; method: &#8216;frameResources.cameraDepthTexture&#8217; and &#8216;frameResources.cameraNormalsTexture&#8217;. <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Packages\/com.unity.render-pipelines.universal\/Runtime\/UniversalRendererRenderGraph.cs#L308\" rel=\"noopener noreferrer nofollow\">UniversalRendererRenderGraph.cs 308<\/a><\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430, \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043d\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 Unity. \u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \u0438\u043c\u0435\u043d\u0430 <code>out<\/code>-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043f\u043e\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043d\u0438\u0445 \u0432 \u0432\u044b\u0437\u043e\u0432\u0435 <code>m_DepthNormalPrepass.Render<\/code>. \u041a\u0430\u0440\u0442\u0430 \u0433\u043b\u0443\u0431\u0438\u043d\u044b \u0438 \u043a\u0430\u0440\u0442\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u0435\u0439 \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043d\u044b \u043c\u0435\u0441\u0442\u0430\u043c\u0438. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u0438 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439, \u043e\u043d\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438. \u0412 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u044d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0437\u0430\u043c\u0435\u0442\u043d\u044b\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u0434\u0435\u0444\u0435\u043a\u0442\u0430\u043c.<\/p>\n<h4>\u041e\u0448\u0438\u0431\u043a\u0430 \u0438\u0437-\u0437\u0430 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 &#8216;??&#8217;<\/h4>\n<pre><code class=\"cs\">public Quaternion? GetCorrectionQuaternion(HumanBodyBones humanBodyBone) {   var targetData = ....;    if (targetData == null)   {     return null;   }   if (!targetData.CorrectionQuaternion.HasValue)   {     return null;   }   return targetData.CorrectionQuaternion.Value; }  private void RetargetHand(....) {   ....   var correctionQuaternion = retargetingLayer.GetCorrectionQuaternion(....);   ....      Transform t = ....;    t.rotation = pose.rotation * correctionQuaternion ?? Quaternion.identity;   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3123\/\" rel=\"noopener noreferrer nofollow\">V3123<\/a> [CWE-783] Perhaps the &#8216;??&#8217; operator works in a different way than it was expected. Its priority is lower than priority of other operators in its left part. <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Assets\/NorthStar\/Scripts\/Player\/SyntheticHandRetargetingProcessor.cs#L89\" rel=\"noopener noreferrer nofollow\">SyntheticHandRetargetingProcessor.cs 89<\/a><\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c:<\/p>\n<pre><code class=\"cs\">t.rotation = pose.rotation * correctionQuaternion ?? Quaternion.identity; <\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0445\u043e\u0434 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 <code>correctionQuaternion<\/code> \u0440\u0430\u0432\u0435\u043d <code>null<\/code>:<\/p>\n<ol>\n<li>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432 <code>null<\/code>, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 <code>null<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>??<\/code>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 <code>t.rotation<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>Quaternion.identity<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p><code>Quaternion.identity<\/code>, \u043f\u043e \u0441\u0443\u0442\u0438, \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0432 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u0432\u044b\u0448\u0435 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0437\u043a\u043e \u043e\u0431\u043d\u0443\u043b\u0451\u043d. \u0412\u0440\u044f\u0434 \u043b\u0438 \u044d\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c, \u0442.\u043a. \u0440\u0435\u0437\u043a\u0438\u0439 \u0441\u0431\u0440\u043e\u0441 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<p>\u041a\u0443\u0434\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>??<\/code> \u0445\u043e\u0442\u0435\u043b\u0438 \u0438\u043c\u0435\u043d\u043d\u043e <code>correctionQuaternion<\/code>, \u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0435 \u0443\u0447\u0451\u043b, \u0447\u0442\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0443 <code>??<\/code> \u043d\u0438\u0436\u0435, \u0447\u0435\u043c \u0443 <code>*<\/code>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">t.rotation = pose.rotation * (correctionQuaternion ?? Quaternion.identity); <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 <code>correctionQuaternion<\/code> \u0440\u0430\u0432\u0435\u043d <code>null<\/code>, \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <code>pose\\.rotation \\* Quaternion\\.identity<\/code>. \u0422.\u043a. \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043a\u0432\u0430\u0442\u0435\u0440\u043d\u0438\u043e\u043d\u0430\u043c\u0438, \u043f\u043e \u0441\u0443\u0442\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u0432\u0430\u0442\u0435\u0440\u043d\u0438\u043e\u043d\u0430 \u043d\u0430 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435, \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u0442\u043e\u0440\u044b\u043c, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u044d\u0442\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e <code>pose\\.rotation<\/code>.&#171;<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u0435\u0449\u0451 \u043e\u0434\u043d\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c open source VR-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c NorthStar, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043d\u0430 Unity. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0438 \u0441 \u0435\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0430 \u0441\u043c\u043e\u0433 \u0431\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0430\u0439\u0442\u0438 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043d\u0451\u043c? \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u0431\u043d\u044b\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u043e\u043c, \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0432 \u043a\u043b\u044e\u0447 <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/try-free\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1279\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>. \u0422\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043f\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 Unity-\u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430\u0439\u0442\u0438 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/6607\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u0410 \u043d\u0430 \u044d\u0442\u043e\u043c \u0443 \u043c\u0435\u043d\u044f \u0432\u0441\u0451. \u0414\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445!<\/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\/940960\/\"> https:\/\/habr.com\/ru\/articles\/940960\/<\/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<p>\u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0438\u0437 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430, \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0443 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u043c\u0438 VR-\u0438\u0433\u0440\u0430\u043c\u0438, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0438 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio. \u0417\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c, NorthStar!<\/p>\n<figure class=\"\"><\/figure>\n<h3>\u041e\u0431 \u0438\u0433\u0440\u0435<\/h3>\n<p><a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\" rel=\"noopener noreferrer nofollow\">NorthStar<\/a> \u2014 \u044d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043d\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043a\u0440\u0430\u0441\u0438\u0432\u0430\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0438\u0433\u0440\u0430, \u0433\u0434\u0435 \u0432\u044b \u043f\u0440\u0438\u043c\u0438\u0442\u0435 \u043d\u0430 \u0441\u0435\u0431\u044f \u0440\u043e\u043b\u044c \u043f\u043e\u0442\u0435\u0440\u043f\u0435\u0432\u0448\u0435\u0433\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u043a\u0440\u0443\u0448\u0435\u043d\u0438\u0435, \u0447\u0443\u0434\u043e\u043c \u0441\u043f\u0430\u0441\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044f Polaris, \u0447\u0430\u0441\u0442\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u043c \u0441\u0443\u0436\u0434\u0435\u043d\u043e \u0441\u0442\u0430\u0442\u044c.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 (\u043e\u0434\u0438\u043d \u043e\u043a\u0435\u0430\u043d \u0447\u0435\u0433\u043e \u0441\u0442\u043e\u0438\u0442), \u0438\u0433\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043e\u043c \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u044f.<\/p>\n<p>\u0412\u0435\u0440\u0451\u0432\u043a\u0438, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043c\u0430\u0442\u044b\u0432\u0430\u0442\u044c, \u0440\u0430\u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0438 \u0442\u043e\u043b\u043a\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041f\u043e\u0434\u0437\u043e\u0440\u043d\u0430\u044f \u0442\u0440\u0443\u0431\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u043b\u0435\u043a\u043e.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0413\u0430\u0440\u043f\u0443\u043d\u043d\u043e\u0435 \u0440\u0443\u0436\u044c\u0451 \u0441 \u0440\u0443\u0447\u043d\u044b\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c: \u0437\u0430\u0440\u044f\u0434\u043a\u0430 \u0431\u043e\u043b\u0442\u0430, \u043d\u0430\u0442\u044f\u0433\u0438\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u0442\u0438\u0432\u044b, \u043f\u0440\u0438\u0446\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0443\u0442\u0435\u043c \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0433\u0430\u0440\u043f\u0443\u043d\u0430 \u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041f\u043e\u043f\u0430\u043b\u0438 \u0433\u0430\u0440\u043f\u0443\u043d\u043e\u043c \u0432\u043e \u0447\u0442\u043e-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435? \u041f\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u0435 \u0440\u0443\u043a\u043e\u044f\u0442\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u043a\u043e\u0440\u0430\u0431\u043b\u044c.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u0438\u0433\u0440\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0438, \u043a\u0430\u043a \u0441\u043c\u0435\u043d\u0430 \u0434\u043d\u044f \u0438 \u043d\u043e\u0447\u0438, \u0441\u043c\u0435\u043d\u0430 \u043f\u043e\u0433\u043e\u0434\u044b, \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u044f, NPC.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0431\u0443\u0434\u0438\u043b\u043e \u043c\u0435\u043d\u044f \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0438\u0433\u0440\u043e\u0439 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u044f, \u043d\u043e \u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u0438\u0441\u043f\u044b\u0442\u0430\u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio.<\/p>\n<h3>\u041e PVS-Studio<\/h3>\n<p>\u041d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0438 \u043d\u0435 \u0447\u0438\u0442\u0430\u043b\u0438 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1278\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/a> \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438.<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u043a\u043e\u0434\u0435 C#, C++, C \u0438 Java \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>PVS-Studio \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438, \u0442\u0430\u043a \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u043c\u0435\u043d\u043d\u043e Unity-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, PVS-Studio \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0443 Unity-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0438\u0445 \u043a\u043e\u0434. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0435 \u0435\u0441\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 API \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d UnityEngine, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 API. \u042d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a, \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u0434\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0434\u043b\u044f Unity-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438, \u0432\u044b\u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439 \u0432 \u0431\u043b\u043e\u043a\u0430\u0445 \u0442\u0430\u043a\u0438\u0445 \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u0430\u043a <code>Update<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u0443\u0447\u0451\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e\/\u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e Unity-\u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0441 <code>null<\/code>. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0442\u0430\u043a\u0436\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0438\u0433\u0440\u0435, \u0447\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c null-\u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043e\u0431 \u044d\u0442\u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/0744\/\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 PVS-Studio \u0441\u0442\u0430\u043b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043d\u0430 Unity<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1236\/\" rel=\"noopener noreferrer nofollow\">PVS-Studio \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 Unity: \u043d\u043e\u0432\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0441\u0442\u043e. \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0442\u0440\u0451\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0448\u0430\u0433\u0430\u043c:<\/p>\n<p>1. \u0417\u0430\u043f\u0443\u0441\u043a \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438\u043b\u0438 \u0432\u0441\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u0438\u043a\u043e\u043c;<\/p>\n<figure class=\"\"><\/figure>\n<p>2. \u041e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u044b\u0445 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043d\u0435\u043b\u0438 \u0438\u043b\u0438 \u0436\u0435 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430;<\/p>\n<figure class=\"\"><\/figure>\n<p>3. \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439. \u041f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u0434\u043e\u0432\u044b\u0445 \u0431\u0430\u0437 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0442\u0440\u0443\u0434\u043e\u0451\u043c\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u043d\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u043e\u0433\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/0032\/\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/a> \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u043a\u043b\u0430\u0434\u043a\u0430 <strong>Best warnings<\/strong>. \u0412 \u043d\u0435\u0439 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0433\u0443\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f Visual Studio, \u043d\u043e PVS-Studio \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 IDE \u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a Rider \u0438 Visual Studio Code. \u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/manual\/0018\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0430\u0439\u0442\u0435<\/a>.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 PVS-Studio \u0432 \u0434\u0435\u043b\u0435?<\/p>\n<h3>O \u043a\u043e\u0434\u0435<\/h3>\n<p>\u041a\u0430\u043a \u0438 \u0432 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1278\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>, \u043e\u0448\u0438\u0431\u043e\u043a \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0431\u044b\u043b\u0438 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445, \u043d\u043e \u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0433\u0440\u044b \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f. \u041d\u0438\u0436\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0430\u043c\u044b\u0435 \u044f\u0432\u043d\u044b\u0435 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445. \u041f\u043e\u0433\u043d\u0430\u043b\u0438!<\/p>\n<h4>\u041f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043f\u043e \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443<\/h4>\n<pre><code class=\"cs\">public void Skip() {   ....   var currTaskIndex = Task.Sequence                           .TaskDefinitions                           .FindIndex(def =&gt; def.ID == TaskID);    if (currTaskIndex != 0)   {     var lastTask = Task.Sequence.TaskDefinitions[currTaskIndex - 1];     ....   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3106\/\" rel=\"noopener noreferrer nofollow\">V3106<\/a> [CWE-125] Possible negative index value. The value of &#8216;currTaskIndex &#8212; 1&#8217; index could reach -2. <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Packages\/com.meta.utilities.narrative\/Runtime\/NarrativeSequence\/TaskHandler.cs#L201\" rel=\"noopener noreferrer nofollow\">TaskHandler.cs 201<\/a><\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u043c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043f\u043e \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443. \u041a\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e; \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 <code>currTaskIndex != 0<\/code> \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u044b\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 <code>-1<\/code>, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u043b\u043e \u0431\u044b \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<h4>\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435 \u0436\u0434\u0430\u043b\u0438<\/h4>\n<pre><code class=\"cs\">public void CollisionPass(....) {   ....   if (!CachedSphereCollider.TryGet(out var sphereCollider)) \/\/ &lt;=   {     return;   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\" rel=\"noopener noreferrer nofollow\">V3022<\/a> [CWE-570] Expression &#8216;!CachedSphereCollider.TryGet(out var sphereCollider)&#8217; is always false. <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Assets\/NorthStar\/Animation\/AnimationScripts\/NPC_DynamicRigs.cs#L522\" rel=\"noopener noreferrer nofollow\">NPC_DynamicRigs.cs 522<\/a><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <code>CachedSphereCollider.TryGet<\/code> \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2014 <code>true<\/code>. \u0422\u0430\u043a \u043b\u0438 \u044d\u0442\u043e? \u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"cs\">public static bool TryGet(out SphereCollider collider) {   if (s_hasSphere)   {     collider = s_sphereCollider;     return true;   }    try   {     ....     s_sphereCollider = obj.GetComponent&lt;SphereCollider&gt;();     collider = s_sphereCollider;     collider.enabled = false;     s_hasSphere = true;     return true;   }   catch   {     ....     throw;   } } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a. \u041e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u041f\u043e \u0438\u0434\u0435\u0435, \u043c\u0435\u0442\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <code>true<\/code> \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 <code>sphereCollider<\/code> \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043c \u0438\u043b\u0438 \u0438\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0438 <code>false<\/code> \u2014 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u041d\u0430 \u0434\u0435\u043b\u0435 \u0436\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043f\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>sphereCollider<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c, \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0431\u0435\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0441\u0442\u0435\u043a\u0443 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <code>CollisionPass<\/code> \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u0442\u043e\u0447\u0435\u043a \u0432\u0445\u043e\u0434\u0430, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <code>LateUpdate<\/code>, \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<h4>\u041f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 null-\u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435<\/h4>\n<pre><code class=\"cs\">private void DisplayResults() {   if (m_texturesWithoutMipmaps.Count &gt; 0)   {     ....   }   else if (m_texturesWithoutMipmaps != null)   {     ....   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3095\/\" rel=\"noopener noreferrer nofollow\">V3095<\/a> [CWE-476] The &#8216;m_texturesWithoutMipmaps&#8217; object was used before it was verified against null. Check lines: 91, 128. <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Assets\/NorthStar\/Editor\/MipMapChecker.cs#L91\" rel=\"noopener noreferrer nofollow\">MipMapChecker.cs 91<\/a><\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 null-\u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 <code>if<\/code>. \u041d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e <code>else if<\/code>. \u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u0430 \u043f\u043e\u0442\u043e\u043c \u0443\u0436\u0435 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0441 <code>null<\/code> \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0439. \u041d\u043e \u0432\u0441\u0451 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c, \u0441\u0442\u043e\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u0435\u0440\u0432\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 <code>?.<\/code>:<\/p>\n<pre><code class=\"cs\">private void DisplayResults() {   if (m_texturesWithoutMipmaps?.Count &gt; 0)   {     ....   }   else if (m_texturesWithoutMipmaps != null)   {     ....   } } <\/code><\/pre>\n<h4>\u041d\u0435\u043d\u0430\u0434\u0451\u0436\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 null<\/h4>\n<pre><code class=\"cs\">public class FadeVolume : MonoBehaviour {   [SerializeField] private AudioSource m_audioSource;   ....   public void FadeOutAudio(float time)   {     if (m_audioSource is null)     {       ....     }     ....   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3216\/\" rel=\"noopener noreferrer nofollow\">V3216<\/a> [CWE-754] Unity Engine. Checking the &#8216;m_audioSource&#8217; field with a specific Unity Engine type for null with &#8216;is&#8217; may not work correctly due to implicit field initialization by the engine. <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Assets\/NorthStar\/Scripts\/Vfx-Sfx\/FadeVolume.cs#L25\" rel=\"noopener noreferrer nofollow\">FadeVolume.cs 25<\/a><\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0435 \u043e\u043f\u0430\u0441\u043d\u0430 \u0432 Release \u0441\u0431\u043e\u0440\u043a\u0435 \u0438\u0433\u0440\u044b, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u043c \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 Unity. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0432 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u0435 \u043f\u043e\u043b\u044f \u0441 \u0442\u0438\u043f\u043e\u043c <code>UnityEngine.Object<\/code> \u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u043c \u043e\u0442 \u043d\u0435\u0433\u043e (\u043a\u0440\u043e\u043c\u0435 <code>MonoBehaviour<\/code> \u0438 <code>ScriptableObject<\/code>) \u043d\u0435\u044f\u0432\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c-\u043f\u0443\u0441\u0442\u044b\u0448\u043a\u043e\u0439, \u0435\u0441\u043b\u0438 \u043d\u0438 \u0432 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u0435, \u043d\u0438 \u0432 \u043a\u043e\u0434\u0435 \u044d\u0442\u0438 \u043f\u043e\u043b\u044f \u043d\u0435 \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0442\u043b\u0430\u0434\u043a\u0438, \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u044d\u0442\u043e:<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043d\u0435\u044f\u0432\u043d\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 null, \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 <code>??<\/code>, <code>??=<\/code>, <code>?.<\/code>,  <code>is null<\/code> \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b, \u0442.\u043a. \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443 \u043f\u043e\u043b\u044f \u0435\u0441\u0442\u044c. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u043d\u0430 <code>null<\/code> \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b <code>==<\/code>, <code>!=<\/code> \u0438\u043b\u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 <code>m_audioSource<\/code>, <code>!m_audioSource<\/code>, \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<h4>\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0446\u0438\u043a\u043b<\/h4>\n<pre><code class=\"cs\">string MemberLabel(string memberName) {   foreach (var memberInfo in currObject.GetType().GetMember(memberName))   {     if (....)     {       memberName = $\"{memberName}()\";     }      return $\"{memberInfo.DeclaringType?.Name}.{memberName}\";   }    return memberName; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3020\/\" rel=\"noopener noreferrer nofollow\">V3020<\/a> [CWE-670] An unconditional &#8216;return&#8217; within a loop. <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Packages\/com.meta.utilities.narrative\/Editor\/MemberLinkDrawer.cs#L162\" rel=\"noopener noreferrer nofollow\">MemberLinkDrawer.cs 162<\/a><\/p>\n<p>\u0421\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u0442 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443 \u043d\u0435\u0433\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f \u0438\u0437-\u0437\u0430 \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e <code>return<\/code> \u0432 \u0442\u0435\u043b\u0435. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e\u0442 <code>return<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0431\u043b\u043e\u043a\u0435 <code>if<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0431\u044b \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u0435\u0435:<\/p>\n<pre><code class=\"cs\">string MemberLabel(string memberName) {   foreach (var memberInfo in currObject.GetType().GetMember(memberName))   {     if (....)     {       memberName = $\"{memberName}()\";       return $\"{memberInfo.DeclaringType?.Name}.{memberName}\";     }   }    return memberName; } <\/code><\/pre>\n<h4>\u041e\u043f\u0435\u0447\u0430\u0442\u043a\u0438<\/h4>\n<p><strong>Issue 1<\/strong><\/p>\n<pre><code class=\"cs\">[Serializable] public struct ComfortPreset {   public float BoatMovementStrength;   public float BoatReactionStrength; } public void ComfortLevelChanged() {   OnComfortLevelChanged?.Invoke(PlayerConfigs.ComfortLevel);   var comfortPreset = ComfortPresets[(int)ComfortLevel];   BoatMovementStrength = comfortPreset.BoatMovementStrength;   BoatReactionStrength = comfortPreset.BoatMovementStrength; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3127\/\" rel=\"noopener noreferrer nofollow\">V3127<\/a> [CWE-682] Two similar code fragments were found. Perhaps, this is a typo and &#8216;BoatReactionStrength&#8217; variable should be used instead of &#8216;BoatMovementStrength&#8217; <a href=\"https:\/\/github.com\/oculus-samples\/Unity-NorthStar\/blob\/d7c4f7c61f0db96d006df3ed52a0c3268881bf7e\/Assets\/NorthStar\/Scripts\/System\/GlobalSettings.cs#L70\" rel=\"noopener noreferrer nofollow\">GlobalSettings.cs 70<\/a>.<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u044f\u0432\u043d\u0443\u044e \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0443: \u043f\u043e\u043b\u044e <code>BoatReactionStrength<\/code> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u042d\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0432\u0435\u0434\u044c \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 <code>ComfortPreset<\/code> \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e. \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">public void ComfortLevelChanged() {   ....   BoatMovementStrength = comfortPreset.BoatMovementStrength;<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/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-472255","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/472255","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=472255"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/472255\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=472255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=472255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=472255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}