{"id":463598,"date":"2025-06-17T09:00:07","date_gmt":"2025-06-17T09:00:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=463598"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=463598","title":{"rendered":"<span>\u041a\u0430\u043a \u044f \u0434\u0435\u043b\u0430\u043b \u0441\u0432\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0438\u0433\u0440\u044b \u043d\u0430 Unity<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0432\u043e\u0434\u043d\u044b\u0435: \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u00a0\u0433\u0435\u0439\u043c\u0434\u0435\u0432\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u0447\u0430\u0442\u044c \u0441\u00a0\u043c\u0430\u043b\u043e\u0433\u043e\u00a0\u2014 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u043e\u0439\u2011\u0442\u043e \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0438\u0433\u0440\u044b \u0441\u00a0\u043d\u0443\u043b\u044f. \u0421\u00a0C# \u0437\u043d\u0430\u043a\u043e\u043c \u043d\u0430\u00a0\u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435, \u0441\u00a0\u0431\u043b\u0435\u043d\u0434\u0435\u0440\u043e\u043c \u043d\u0430\u00a0\u043d\u0443\u043b\u0435\u0432\u043e\u043c), \u0441\u00a0Unity \u0447\u0443\u0442\u044c\u2011\u0447\u0443\u0442\u044c (\u0434\u0435\u043b\u0430\u043b \u0442\u0435\u0442\u0440\u0438\u0441, \u0438 \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u0435\u0440 \u0434\u043b\u044f\u00a0\u043d\u0435\u0433\u043e \u043f\u043e\u0432\u0435\u0440\u0445 Steam \u0447\u0435\u0440\u0435\u0437 Spacewar).<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0438\u0434\u0435\u044f\u00a0\u0431\u044b\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u2011\u0442\u043e \u043d\u0430\u00a0\u043c\u0438\u043d\u0443\u0442 10\u201315, \u043a\u0430\u043a\u00a0\u043e\u0431\u044b\u0447\u043d\u043e \u0432\u00a0\u0433\u043e\u043b\u043e\u0432\u0435 \u043c\u043d\u043e\u0433\u043e \u0438\u0434\u0435\u0439 \u0438 \u043c\u0435\u043b\u043e\u0447\u0435\u0439, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u0439, \u043d\u043e\u00a0\u043a\u043e\u0433\u0434\u0430 \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u0435\u043b\u043e \u0434\u043e\u00a0\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u00a0\u043d\u0435\u00a0\u0432\u0441\u0435 \u0442\u0430\u043a \u043b\u0435\u0433\u043a\u043e, \u043a\u0430\u043a\u00a0\u043a\u0430\u0436\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0412\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u043a\u043e\u0439\u2011\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0439 \u0445\u043e\u0440\u0440\u043e\u0440 \u0438\u0433\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0439\u0442\u0438, \u0442.\u043a. \u043e\u043f\u044b\u0442\u0430 \u0432\u00a0Blender \u0443\u00a0\u043c\u0435\u043d\u044f \u043d\u0435\u0442, \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u2011\u0442\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043f\u0430\u0440\u0443 \u0433\u0430\u0439\u0434\u043e\u0432 \u043d\u0430\u00a0\u044e\u0442\u0443\u0431\u0435 \u0438 \u043d\u0430\u0447\u0430\u043b \u00ab\u0442\u0432\u043e\u0440\u0438\u0442\u044c\u00bb.<\/p>\n<p>\u0420\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u00a0\u0432\u0438\u0434\u0435 \u0442\u0430\u0439\u043b\u043e\u0432, \u0438\u0437\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0431\u0435\u0440\u0443 \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0438 \u043a\u043e\u0440\u0438\u0434\u043e\u0440\u044b \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438, \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u043d\u0430\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u0440\u0430\u0433\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0431\u0435\u0433\u0430\u0442\u044c \u0437\u0430\u00a0\u0438\u0433\u0440\u043e\u043a\u043e\u043c.<\/p>\n<p>\u0421\u0442\u0435\u043d\u0430\u00a0\u0431\u044b\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u0438\u0437\u00a0\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0435\u0439, \u043d\u0430\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0435\u00a0\u0431\u044b\u043b\u0430 \u043d\u0430\u0442\u044f\u043d\u0443\u0442\u0430 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0430 \u043a\u0438\u0440\u043f\u0438\u0447\u043d\u043e\u0439 \u043a\u043b\u0430\u0434\u043a\u0438, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b44\/136\/0e7\/b441360e7b7ce89957f591265d8d3458.png\" alt=\"4 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u0443\" title=\"4 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u0443\" width=\"1113\" height=\"693\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/b44\/136\/0e7\/b441360e7b7ce89957f591265d8d3458.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b44\/136\/0e7\/b441360e7b7ce89957f591265d8d3458.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>4\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u0443<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0440\u0430\u0433\u0430 \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043a\u0435\u043b\u0435\u0442\u0430, \u043d\u0430\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0442\u044f\u043d\u0443\u043b \u0442\u043a\u0430\u043d\u044c (\u043a\u0430\u043a\u00a0\u0436\u0435 \u0441\u00a0\u043d\u0435\u0439 \u0432\u0435\u0441\u0435\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c\u00a0\u2014 <s>\u043d\u0435\u0442<\/s>), \u0442.\u043a. \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u043e\u043f\u044b\u0442 \u043f\u0440\u043e\u0448\u0443 \u043d\u0435\u00a0\u0441\u0443\u0434\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u0433\u043e)<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c71\/32f\/a39\/c7132fa39c3578ba5113faf2d8ef4cde.png\" alt=\"\u041c\u043e\u0434\u0435\u043b\u044c \u0432\u0440\u0430\u0433\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043a\u0435\u043b\u0435\u0442\u0430\" title=\"\u041c\u043e\u0434\u0435\u043b\u044c \u0432\u0440\u0430\u0433\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043a\u0435\u043b\u0435\u0442\u0430\" width=\"834\" height=\"823\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/c71\/32f\/a39\/c7132fa39c3578ba5113faf2d8ef4cde.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c71\/32f\/a39\/c7132fa39c3578ba5113faf2d8ef4cde.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041c\u043e\u0434\u0435\u043b\u044c \u0432\u0440\u0430\u0433\u0430 \u0432\u00a0\u0432\u0438\u0434\u0435 \u0441\u043a\u0435\u043b\u0435\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c1b\/744\/678\/c1b744678859aaddf43f97538f680646.png\" alt=\"\u0411\u0435\u0437 \u0442\u043a\u0430\u043d\u0438\" title=\"\u0411\u0435\u0437 \u0442\u043a\u0430\u043d\u0438\" width=\"690\" height=\"783\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/c1b\/744\/678\/c1b744678859aaddf43f97538f680646.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c1b\/744\/678\/c1b744678859aaddf43f97538f680646.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0411\u0435\u0437\u00a0\u0442\u043a\u0430\u043d\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u043c\u043e\u0434\u0435\u043b\u044c\u043a\u0443 \u0430\u043b\u0442\u0430\u0440\u044f \u0438 \u043a\u0443\u0431\u0438\u043a\u0430 \u043d\u0430\u00a0\u043d\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0439\u0442\u0438 \u0438\u0433\u0440\u0443<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u043a\u0438\u00a0\u0431\u044b\u043b\u0438 \u0433\u043e\u0442\u043e\u0432\u044b, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043b \u043a\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043a\u043e\u043c\u043d\u0430\u0442. \u0420\u0435\u0448\u0438\u043b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0434\u043e\u0432 \u043a\u043e\u043c\u043d\u0430\u0442 \u0438 \u043f\u0440\u0435\u0444\u0430\u0431 \u043a\u043e\u0440\u0438\u0434\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u043e\u0442\u043e\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043b 3\u00a0\u0432\u0438\u0434\u0430 \u043a\u043e\u043c\u043d\u0430\u0442, \u043d\u043e\u00a0\u043f\u043e\u0442\u043e\u043c \u0440\u0435\u0448\u0438\u043b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u00a0\u0434\u0432\u0443\u0445\u00a0\u2014 \u043f\u0443\u0441\u0442\u0430\u044f \u0438 \u0442\u0430, \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0435\u0441\u0442\u044c \u0430\u043b\u0442\u0430\u0440\u044c \u0441\u00a0\u043a\u0443\u0431\u0438\u043a\u043e\u043c.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/694\/dd1\/7b0\/694dd17b04c2033467389993f3fe4bdf.png\" alt=\"\u041f\u0443\u0441\u0442\u0430\u044f \u043a\u043e\u043c\u043d\u0430\u0442\u0430\" title=\"\u041f\u0443\u0441\u0442\u0430\u044f \u043a\u043e\u043c\u043d\u0430\u0442\u0430\" width=\"1734\" height=\"837\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/694\/dd1\/7b0\/694dd17b04c2033467389993f3fe4bdf.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/694\/dd1\/7b0\/694dd17b04c2033467389993f3fe4bdf.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0443\u0441\u0442\u0430\u044f \u043a\u043e\u043c\u043d\u0430\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a4b\/978\/b9f\/a4b978b9fc5ba222d52a7138efc7cee8.png\" alt=\"\u041a\u043e\u043c\u043d\u0430\u0442\u0430 \u0441 \u0430\u043b\u0442\u0430\u0440\u0435\u043c\" title=\"\u041a\u043e\u043c\u043d\u0430\u0442\u0430 \u0441 \u0430\u043b\u0442\u0430\u0440\u0435\u043c\" width=\"1744\" height=\"861\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a4b\/978\/b9f\/a4b978b9fc5ba222d52a7138efc7cee8.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a4b\/978\/b9f\/a4b978b9fc5ba222d52a7138efc7cee8.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041a\u043e\u043c\u043d\u0430\u0442\u0430 \u0441\u00a0\u0430\u043b\u0442\u0430\u0440\u0435\u043c<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5a6\/f3f\/fdd\/5a6f3ffddd03747031f6abf11c14c85b.png\" alt=\"\u0417\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0442\u0443\u043c\u0430\u043d \u0438 \u0444\u043e\u043d\u0430\u0440\u0438\u043a\" title=\"\u0417\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0442\u0443\u043c\u0430\u043d \u0438 \u0444\u043e\u043d\u0430\u0440\u0438\u043a\" width=\"1795\" height=\"862\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/5a6\/f3f\/fdd\/5a6f3ffddd03747031f6abf11c14c85b.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5a6\/f3f\/fdd\/5a6f3ffddd03747031f6abf11c14c85b.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0417\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0442\u0443\u043c\u0430\u043d \u0438 \u0444\u043e\u043d\u0430\u0440\u0438\u043a<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043b \u043a\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f\u00a0\u043a\u043e\u043c\u043d\u0430\u0442. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u0440\u043e\u0441\u0442\u00a0\u2014 \u0443\u00a0\u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u044f \u043a\u043e\u043c\u043d\u0430\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430, \u0443\u00a0\u043d\u0435\u0435 \u0435\u0441\u0442\u044c 4\u00a0\u0432\u044b\u0445\u043e\u0434\u0430, \u0437\u0430\u0434\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u043d\u0430\u0442 \u0441\u00a0\u0430\u043b\u0442\u0430\u0440\u044f\u043c\u0438 \u0438 \u043a\u043e\u043c\u043d\u0430\u0442 \u0431\u0435\u0437\u00a0\u043d\u0438\u0445, \u0437\u0430\u0442\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0435\u0437\u0430\u043d\u044f\u0442\u044b\u0439 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437\u00a0\u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0438 \u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0430\u043c \u043a\u043e\u0440\u0438\u0434\u043e\u0440, \u0430\u00a0\u043d\u0430\u00a0\u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u0440\u0438\u0434\u043e\u0440\u0430 \u043a\u043e\u043c\u043d\u0430\u0442\u0443, \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0442\u0430\u043a, \u043f\u043e\u043a\u0430 \u043d\u0435\u00a0\u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u043a\u043e\u043c\u043d\u0430\u0442\u044b.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0441\u00a0\u0430\u043b\u0442\u0430\u0440\u044f\u043c\u0438, \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u043a\u0430\u043a\u00a0\u043c\u043e\u0436\u043d\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u043e\u0442\u00a0\u0438\u0433\u0440\u043e\u043a\u0430, \u043d\u043e\u00a0\u043f\u043e\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u00a0\u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0441\u00a0\u0430\u043b\u0442\u0430\u0440\u044f\u043c\u0438 \u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u043e\u043a\u043e\u043b\u043e \u0434\u0440\u0443\u0433\u0430 \u0432\u00a0\u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0442\u0430\u043c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043d\u0435\u0437\u0430\u043d\u044f\u0442\u044b\u0435 \u0432\u044b\u0445\u043e\u0434\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430\u00a0\u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u044e \u0434\u043e\u00a0\u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0430\u043b\u0442\u0430\u0440\u044f, \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u0415\u0441\u043b\u0438 \u0432\u00a0\u043a\u043e\u043d\u0446\u0435 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0435\u0437\u0430\u043d\u044f\u0442\u044b\u0435 \u0432\u044b\u0445\u043e\u0434\u044b, \u0442\u043e \u043e\u043d\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u0442\u0435\u043d\u043e\u0439, \u0438\u0437\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043a\u043e\u043c\u043d\u0430\u0442\u0430.<\/p>\n<p>\u0412\u00a0\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441\u00a0\u0431\u0430\u0433\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u00a0\u0441\u043c\u043e\u0433 \u0440\u0435\u0448\u0438\u0442\u044c, \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c \u043e\u0431\u0434\u0443\u043c\u044b\u0432\u0430\u043b \u043a\u0430\u043a\u00a0\u043c\u043e\u0436\u043d\u043e\u00a0\u0431\u044b\u043b\u043e\u00a0\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u043e\u0439 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0435\u0433\u043e, \u043d\u0430\u00a0\u0431\u0443\u0434\u0443\u0449\u0435\u0435 \u0431\u0443\u0434\u0443 \u0437\u043d\u0430\u0442\u044c. \u0411\u0430\u0433 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0441\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u043a\u043e\u043c\u043d\u0430\u0442\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u0432\u00a0\u0434\u0440\u0443\u0433\u0435, \u0435\u0441\u043b\u0438 \u0434\u0432\u0435 \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0441\u0432\u043e\u0438\u043c\u0438 \u0432\u044b\u0445\u043e\u0434\u0430\u043c\u0438 \u0441\u043c\u043e\u0442\u0440\u044f\u0442 \u0434\u0440\u0443\u0433 \u043d\u0430\u00a0\u0434\u0440\u0443\u0433\u0430, \u0430\u00a0\u0437\u0430\u0442\u0435\u043c \u043e\u0431\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u0432\u043e\u0438 \u0432\u044b\u0445\u043e\u0434\u044b \u0434\u043b\u044f\u00a0\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0439 \u043a\u043e\u043c\u043d\u0430\u0442\u044b.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/60c\/8ca\/574\/60c8ca574957c179c3d75922e599e4d2.png\" alt=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 1\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 1\" width=\"1623\" height=\"857\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/60c\/8ca\/574\/60c8ca574957c179c3d75922e599e4d2.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/60c\/8ca\/574\/60c8ca574957c179c3d75922e599e4d2.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 1<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a4a\/87b\/caf\/a4a87bcafba0f4cc4d1e842f8604069d.png\" alt=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 2\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 2\" width=\"1374\" height=\"869\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a4a\/87b\/caf\/a4a87bcafba0f4cc4d1e842f8604069d.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a4a\/87b\/caf\/a4a87bcafba0f4cc4d1e842f8604069d.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 2<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/992\/c3d\/f77\/992c3df777748ce8d10103eba938014f.png\" alt=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \" width=\"1699\" height=\"879\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/992\/c3d\/f77\/992c3df777748ce8d10103eba938014f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/992\/c3d\/f77\/992c3df777748ce8d10103eba938014f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 <\/figcaption><\/div>\n<\/figure>\n<p><strong>\u041a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438:<\/strong><\/p>\n<p>\u0412\u00a0\u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435 \u043d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0441\u043a\u0440\u0438\u043f\u0442, \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u00a0\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u043e\u0434\u0437\u0435\u043c\u0435\u043b\u044c\u044f, \u043e\u0441\u043e\u0431\u043e \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043b\u0443\u0447\u0448\u0435 \u043d\u0435\u00a0\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0442\u0430\u043c \u0432\u0441\u0435 \u00ab\u0442\u044f\u043f\u2011\u043b\u044f\u043f\u00bb.<\/p>\n<pre><code class=\"cs\">using Assets.Scipts; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; using static UnityEngine.GraphicsBuffer;  public class LevelGenerator : MonoBehaviour {     public GameObject CrossRoomPrefab;     public GameManager gameManager;     public GameObject AltarRoomPrefab;     public GameObject CorridorPrefab;     public GameObject EmptyRoomPrefab;     public GameObject WallExitPrefab;     public GameObject Player;     public int NumberOfRooms = 5;     public int NumberOfAltarRooms = 2;     private int AlreadyPickupedRunes = 0;     public double RadiusToCheckExistingOfAltars = 15;     public Vector3 StartPosition = Vector3.zero;     public event Action AllRunesCollectedEvent;     public event Action OneRuneCollectedEvent;      private List&lt;GameObject&gt; placedRooms = new List&lt;GameObject&gt;();     private List&lt;RoomInfo&gt; roomInfos = new List&lt;RoomInfo&gt;();     public List&lt;Vector3&gt; AltarRoomPositions = new List&lt;Vector3&gt;();      public void GenerateLevel()     {         GameObject startRoom = Instantiate(EmptyRoomPrefab, StartPosition, Quaternion.identity);         placedRooms.Add(startRoom);         roomInfos.Add(startRoom.GetComponent&lt;RoomInfo&gt;());         PlaceEmptyRooms();         PlaceAltarRooms();         CloseFreeExists();     }      RoomInfo FindFirstRoomWithFreeExit()     {         for (int i = 0; i &lt; roomInfos.Count; i++)         {             if (roomInfos[i].FreeExits.Count &gt; 0)             {                 return roomInfos[i];             }         }          return null;     }      void OccupieExit(RoomInfo roomInfo, GameObject objectToOccupie)     {         roomInfo.OccupiedExits.Add(objectToOccupie);         roomInfo.FreeExits.Remove(objectToOccupie);     }      Transform FindFarthestFreeExitFromPoint(Vector3 pos)     {         Transform farthestExit = null;         float maxDistance = float.MinValue;          for (int i = 0; i &lt; roomInfos.Count; i++)         {             for (int j = 0; j &lt; roomInfos[i].FreeExits.Count; j++)             {                 Transform freeExitTransform = roomInfos[i].FreeExits[j].transform;                 float distance = Vector3.Distance(pos, freeExitTransform.position);                 if (distance &gt; maxDistance &amp;&amp; !IsPositionTooCloseToAltarRooms(freeExitTransform.position))                 {                     maxDistance = distance;                     farthestExit = roomInfos[i].FreeExits[j].transform;                 }             }         }          return farthestExit;     }      bool IsPositionTooCloseToAltarRooms(Vector3 position)     {         foreach (Vector3 altarPosition in AltarRoomPositions)         {             if (Vector3.Distance(position, altarPosition) &lt; RadiusToCheckExistingOfAltars)             {                 return true;             }         }         return false;     }      void PlaceEmptyRooms()     {         for (int i = 0; i &lt; NumberOfRooms; i++)         {             Transform oldExit = FindFirstRandomRoomWithFreeExit();              if (oldExit == null)             {                 break;             }              Transform corridorExit;              PlaceCorridor(oldExit, out corridorExit);              GameObject newRoom = Instantiate(EmptyRoomPrefab);             Transform newRoomEntrance = newRoom.GetComponent&lt;RoomInfo&gt;().FreeExits.First().transform;             Quaternion roomRotation = Quaternion.FromToRotation(-newRoomEntrance.forward, corridorExit.forward);             newRoom.transform.rotation = roomRotation;             newRoom.transform.position = corridorExit.position - (newRoom.transform.rotation * newRoomEntrance.localPosition);              RoomInfo newRoomInfo = newRoom.GetComponent&lt;RoomInfo&gt;();             placedRooms.Add(newRoom);             roomInfos.Add(newRoomInfo);             OccupieExit(newRoomInfo, newRoomEntrance.gameObject);             OccupieExit(corridorExit.GetComponentInParent&lt;RoomInfo&gt;(), corridorExit.gameObject);         }     }     void PlaceAltarRooms()     {         for (int i = 0; i &lt; NumberOfAltarRooms; i++)         {             Transform farthestExit = FindFarthestFreeExitFromPoint(Vector3.zero);              if (farthestExit == null)             {                 Debug.LogWarning(\"\u041d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432\u044b\u0445\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0441 \u0430\u043b\u0442\u0430\u0440\u0451\u043c.\");                 break;             }              Transform corridorExit;              PlaceCorridor(farthestExit, out corridorExit);              Transform newRoomEntrance = AltarRoomPrefab.GetComponent&lt;RoomInfo&gt;().FreeExits.First().transform;             Quaternion rotationDifference = Quaternion.FromToRotation(-newRoomEntrance.forward, corridorExit.forward);             Vector3 newPosition = corridorExit.position - (rotationDifference * newRoomEntrance.localPosition);              GameObject newRoom = Instantiate(AltarRoomPrefab, newPosition, rotationDifference * AltarRoomPrefab.transform.rotation);             RoomInfo newRoomInfo = newRoom.GetComponent&lt;RoomInfo&gt;();              placedRooms.Add(newRoom);             roomInfos.Add(newRoomInfo);             AltarRoomPositions.Add(newPosition);             \/\/OccupieExit(newRoomInfo, newRoomEntrance.gameObject);             OccupieExit(newRoomInfo, newRoom.GetComponent&lt;RoomInfo&gt;().FreeExits.First().transform.gameObject);             OccupieExit(corridorExit.GetComponentInParent&lt;RoomInfo&gt;(), corridorExit.gameObject);         }     }      void PlaceCorridor(Transform startPosition, out Transform otherExitFromCorridor)     {         GameObject corridor = Instantiate(CorridorPrefab);         Transform corridorEntrance = corridor.GetComponent&lt;RoomInfo&gt;().FreeExits.First().transform;         Quaternion corridorRotation = Quaternion.FromToRotation(-corridorEntrance.forward, startPosition.forward);         corridor.transform.rotation = corridorRotation;         corridor.transform.position = startPosition.position - (corridor.transform.rotation * corridorEntrance.localPosition);          RoomInfo corridorInfo = corridor.GetComponent&lt;RoomInfo&gt;();         placedRooms.Add(corridor);         roomInfos.Add(corridorInfo);         OccupieExit(corridorInfo, corridorEntrance.gameObject);         OccupieExit(startPosition.GetComponentInParent&lt;RoomInfo&gt;(), startPosition.gameObject);          Transform corridorExit = corridorInfo.FreeExits.First().transform;          otherExitFromCorridor = corridorExit;     }      Transform FindFirstRandomRoomWithFreeExit()     {         List&lt;GameObject&gt; exits = new List&lt;GameObject&gt;();         exits = roomInfos.Where(x =&gt; x.FreeExits.Count &gt; 0).SelectMany(x =&gt; x.FreeExits).ToList();         if (exits.Count != 0)         {             System.Random rnd = new System.Random();             return exits.ElementAt(rnd.Next(exits.Count)).transform;         }          return null;     }      void CloseFreeExists()     {         List&lt;GameObject&gt; exits = new List&lt;GameObject&gt;();         exits = roomInfos.Where(x =&gt; x.FreeExits.Count &gt; 0).SelectMany(x =&gt; x.FreeExits).ToList();         for (int i = 0; i &lt; exits.Count; i++)         {             GameObject wall = Instantiate(WallExitPrefab);             Quaternion wallRotation; \/\/= Quaternion.FromToRotation(-wall.transform.forward, exits[i].transform.forward);             wallRotation = Quaternion.LookRotation(-exits[i].transform.forward, Vector3.up);             wall.transform.rotation = wallRotation;             wall.transform.position = exits[i].transform.position;             OccupieExit(exits[i].GetComponentInParent&lt;RoomInfo&gt;(), wall);         }     }     void RuneWasPickuped()     {         AlreadyPickupedRunes++;         OneRuneCollectedEvent?.Invoke();         if (AlreadyPickupedRunes &gt;= NumberOfAltarRooms)         {             AllRunesCollectedEvent?.Invoke();         }     }     public void SubscribeOnPlayer(Movement movement)     {         movement.RunePickuped += RuneWasPickuped;     }     void OnDrawGizmos()     {         foreach (var room in placedRooms)         {             Collider col = room.GetComponent&lt;Collider&gt;();             if (col == null) continue;             Gizmos.color = Color.red;             Gizmos.DrawWireCube(col.bounds.center, col.bounds.size);         }     }     bool IsOverlappingWithOtherRooms(GameObject newRoom)     {         Collider newCol = newRoom.GetComponent&lt;Collider&gt;();         if (newCol == null) return false;          Bounds newBounds = newCol.bounds;                  foreach (GameObject placed in placedRooms)         {             if (placed.tag != \"Room\") continue;             Collider col = placed.GetComponent&lt;Collider&gt;();             if (col == null) continue;              Bounds placedBounds = col.bounds;              if (newBounds.Intersects(placedBounds))             {                 return true;             }         }          return false;     } } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u00a0\u043f\u043e\u0434\u0431\u043e\u0440\u0435 \u0438\u0433\u0440\u043e\u043a\u043e\u043c \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u0443\u0431\u0438\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043f\u0430\u0432\u043d \u0432\u0440\u0430\u0433\u0430 \u0437\u0430\u00a0\u0441\u043f\u0438\u043d\u043e\u0439 \u0438\u0433\u0440\u043e\u043a\u0430, \u0438 \u0438\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u0440\u0438\u043a\u0430, \u0437\u0430\u0442\u0435\u043c \u0438\u0433\u0440\u043e\u043a\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043a\u0443\u0431\u0438\u043a\u0438, \u043f\u043e\u043a\u0430 \u0437\u0430\u00a0\u043d\u0438\u043c \u0433\u043e\u043d\u0438\u0442\u0441\u044f \u0432\u0440\u0430\u0433, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u00a0\u043f\u043e\u0434\u0431\u043e\u0440\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u0443\u0431\u0438\u043a\u0430 \u0438\u0433\u0440\u043e\u043a\u0443\u00a0\u0431\u044b\u043b\u043e\u00a0\u0431\u044b \u0432\u0441\u0435 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0443\u0431\u0435\u0433\u0430\u0442\u044c, \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b, \u043f\u043e\u00a0\u0442\u0438\u043f\u0443 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u0438\u043b\u0438\u00a0\u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0438\u0439, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u043a\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043d\u043e\u00a0\u0440\u0435\u0448\u0438\u043b \u043d\u0435\u00a0\u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u0442\u0430\u043a, \u0447\u0442\u043e\u00a0\u043a\u043e\u0433\u0434\u0430 \u0438\u0433\u0440\u043e\u043a \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043a\u0443\u0431\u0438\u043a, \u0442\u043e \u0432\u0440\u0430\u0433 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438\u00a0\u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0430\u0435\u0442\u0441\u044f \u043a\u00a0\u0438\u0433\u0440\u043e\u043a\u0443, \u0434\u0430\u043b\u0435\u0435 \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u00a0\u2014\u00a0\u043b\u0438\u0431\u043e \u0441\u043c\u0435\u0440\u0442\u044c,\u00a0\u043b\u0438\u0431\u043e \u0443\u0431\u0438\u0439\u0441\u0442\u0432\u043e \u0432\u0440\u0430\u0433\u0430 \u0441\u00a0\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0435\u0432\u043e\u043b\u044c\u0432\u0435\u0440\u0430 (\u0432\u0437\u044f\u043b \u0438\u0437\u00a0\u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0430\u0441\u0441\u0435\u0442 \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0440\u0435\u0432\u043e\u043b\u044c\u0432\u0435\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u00a0\u0441\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0438\u0432\u0430\u043b\u0441\u044f \u0438\u0437\u00a0\u0441\u0442\u0438\u043b\u044f), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043a\u0443\u0431\u0438\u043a\u0430. (\u0414\u0443\u043c\u0430\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u2011\u0442\u043e \u0432\u00a0\u0431\u043e\u043b\u0435\u0435 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435, \u0447\u0442\u043e\u0431\u044b \u0443\u00a0\u043d\u0430\u0441\u00a0\u0431\u044b\u043b \u043d\u0435\u00a0\u0440\u0435\u0432\u043e\u043b\u044c\u0432\u0435\u0440, \u0430\u00a0\u0443\u0441\u043b\u043e\u0432\u043d\u0430\u044f \u043a\u043d\u0438\u0433\u0430, \u0441\u00a0\u0437\u0430\u043a\u043b\u0438\u043d\u0430\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u0432\u044b\u0439\u0442\u0438 \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u0435\u043c, \u043d\u043e\u00a0\u043e\u0442\u0431\u0440\u043e\u0441\u0438\u043b \u044d\u0442\u0443 \u0438\u0434\u0435\u044e, \u0442.\u043a. \u043d\u0435\u00a0\u0441\u043c\u043e\u0433\u00a0\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e \u0437\u0430\u043a\u043b\u0438\u043d\u0430\u043d\u0438\u0435 \u043d\u0430 +\u2011 \u0441\u043d\u043e\u0441\u043d\u043e\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435)<\/p>\n<p>\u0412\u00a0\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043d\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e \u043f\u043e\u00a0\u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u00a0\u043c\u043e\u0434\u0435\u043b\u044c\u043a\u0430\u043c\u0438, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u00a0\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u043e\u043c \u0432\u00a0Unity \u0438\u00a0\u0442.\u00a0\u0434., \u0441\u00a0\u043a\u043e\u0434\u043e\u043c\u00a0\u0431\u044b\u043b\u043e \u043f\u043e\u043f\u0440\u043e\u0449\u0435.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1d8\/880\/ef1\/1d8880ef1b44cd479b0669e0881a429f.png\" alt=\"\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0443\u0431\u0438\u043a \u0432 Blender, \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0437\u0430\u043f\u0435\u043a\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0432 Unity, \u043d\u043e \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e, \u043b\u0438\u0431\u043e \u044f \u0432\u0443\u043f\u0441\u0435\u043d\u044c\" title=\"\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0443\u0431\u0438\u043a \u0432 Blender, \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0437\u0430\u043f\u0435\u043a\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0432 Unity, \u043d\u043e \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e, \u043b\u0438\u0431\u043e \u044f \u0432\u0443\u043f\u0441\u0435\u043d\u044c\" width=\"777\" height=\"517\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/1d8\/880\/ef1\/1d8880ef1b44cd479b0669e0881a429f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1d8\/880\/ef1\/1d8880ef1b44cd479b0669e0881a429f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041a\u0430\u043a\u00a0\u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0443\u0431\u0438\u043a \u0432\u00a0Blender, \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0437\u0430\u043f\u0435\u043a\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0432\u00a0Unity, \u043d\u043e\u00a0\u043d\u0435\u00a0\u043f\u043e\u043c\u043e\u0433\u043b\u043e<s>,\u00a0\u043b\u0438\u0431\u043e \u044f \u0432\u0443\u043f\u0441\u0435\u043d\u044c<\/s><\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u044b\u0432\u043e\u0434: \u043c\u043e\u0434\u0435\u043b\u044c\u043a\u0438\u00a0\u2014 \u044d\u0442\u043e \u0442\u044f\u0436\u0435\u043b\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u00a0\u043b\u0438\u0431\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u00a0\u043f\u0430\u0440\u0435 \u0441\u00a0\u043a\u0435\u043c\u2011\u0442\u043e, \u043a\u0442\u043e \u0432\u00a0\u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f,\u00a0\u043b\u0438\u0431\u043e \u043d\u0430\u0439\u0442\u0438 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0430\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439\u00a0\u043b\u0438\u0448\u0438\u0442 \u043d\u0430\u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u0438 \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u0441\u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043d\u043e\u00a0\u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u043a\u0443\u0447\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u0412\u00a0\u0446\u0435\u043b\u043e\u043c, \u044f \u0440\u0430\u0434, \u0447\u0442\u043e\u00a0\u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u2011\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0438 \u0434\u043e\u0432\u0435\u043b \u044d\u0442\u043e \u0434\u043e, \u043f\u043e\u00a0\u043c\u043e\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u0443\u0440\u043e\u0432\u043d\u044f \u00ab\u043f\u043e\u0439\u0434\u0435\u0442\u00bb, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e\u00a0\u0432\u00a0\u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0441\u044f \u043b\u0443\u0447\u0448\u0435 \u0438 \u043b\u0443\u0447\u0448\u0435. \u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0433\u0440\u0443 \u0438 \u043f\u043e\u0431\u0435\u0433\u0430\u0442\u044c, \u0442\u043e \u0432\u043e\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 <a href=\"https:\/\/misle92.itch.io\/dungeon-runner\" rel=\"noopener noreferrer nofollow\">itch.io<\/a><\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430\u00a0\u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435!<\/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\/919034\/\"> https:\/\/habr.com\/ru\/articles\/919034\/<\/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>\u0412\u0432\u043e\u0434\u043d\u044b\u0435: \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u00a0\u0433\u0435\u0439\u043c\u0434\u0435\u0432\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u0447\u0430\u0442\u044c \u0441\u00a0\u043c\u0430\u043b\u043e\u0433\u043e\u00a0\u2014 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u043e\u0439\u2011\u0442\u043e \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0438\u0433\u0440\u044b \u0441\u00a0\u043d\u0443\u043b\u044f. \u0421\u00a0C# \u0437\u043d\u0430\u043a\u043e\u043c \u043d\u0430\u00a0\u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435, \u0441\u00a0\u0431\u043b\u0435\u043d\u0434\u0435\u0440\u043e\u043c \u043d\u0430\u00a0\u043d\u0443\u043b\u0435\u0432\u043e\u043c), \u0441\u00a0Unity \u0447\u0443\u0442\u044c\u2011\u0447\u0443\u0442\u044c (\u0434\u0435\u043b\u0430\u043b \u0442\u0435\u0442\u0440\u0438\u0441, \u0438 \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u0435\u0440 \u0434\u043b\u044f\u00a0\u043d\u0435\u0433\u043e \u043f\u043e\u0432\u0435\u0440\u0445 Steam \u0447\u0435\u0440\u0435\u0437 Spacewar).<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0438\u0434\u0435\u044f\u00a0\u0431\u044b\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u2011\u0442\u043e \u043d\u0430\u00a0\u043c\u0438\u043d\u0443\u0442 10\u201315, \u043a\u0430\u043a\u00a0\u043e\u0431\u044b\u0447\u043d\u043e \u0432\u00a0\u0433\u043e\u043b\u043e\u0432\u0435 \u043c\u043d\u043e\u0433\u043e \u0438\u0434\u0435\u0439 \u0438 \u043c\u0435\u043b\u043e\u0447\u0435\u0439, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0433\u0435\u0439\u043c\u043f\u043b\u0435\u0439, \u043d\u043e\u00a0\u043a\u043e\u0433\u0434\u0430 \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u0435\u043b\u043e \u0434\u043e\u00a0\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u00a0\u043d\u0435\u00a0\u0432\u0441\u0435 \u0442\u0430\u043a \u043b\u0435\u0433\u043a\u043e, \u043a\u0430\u043a\u00a0\u043a\u0430\u0436\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0412\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u043a\u043e\u0439\u2011\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u043e\u0439 \u0445\u043e\u0440\u0440\u043e\u0440 \u0438\u0433\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0439\u0442\u0438, \u0442.\u043a. \u043e\u043f\u044b\u0442\u0430 \u0432\u00a0Blender \u0443\u00a0\u043c\u0435\u043d\u044f \u043d\u0435\u0442, \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e\u2011\u0442\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043f\u0430\u0440\u0443 \u0433\u0430\u0439\u0434\u043e\u0432 \u043d\u0430\u00a0\u044e\u0442\u0443\u0431\u0435 \u0438 \u043d\u0430\u0447\u0430\u043b \u00ab\u0442\u0432\u043e\u0440\u0438\u0442\u044c\u00bb.<\/p>\n<p>\u0420\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u00a0\u0432\u0438\u0434\u0435 \u0442\u0430\u0439\u043b\u043e\u0432, \u0438\u0437\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0431\u0435\u0440\u0443 \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0438 \u043a\u043e\u0440\u0438\u0434\u043e\u0440\u044b \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438, \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u043d\u0430\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u0440\u0430\u0433\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0431\u0435\u0433\u0430\u0442\u044c \u0437\u0430\u00a0\u0438\u0433\u0440\u043e\u043a\u043e\u043c.<\/p>\n<p>\u0421\u0442\u0435\u043d\u0430\u00a0\u0431\u044b\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u0438\u0437\u00a0\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0435\u0439, \u043d\u0430\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0435\u00a0\u0431\u044b\u043b\u0430 \u043d\u0430\u0442\u044f\u043d\u0443\u0442\u0430 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0430 \u043a\u0438\u0440\u043f\u0438\u0447\u043d\u043e\u0439 \u043a\u043b\u0430\u0434\u043a\u0438, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>4\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u0443<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0440\u0430\u0433\u0430 \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043a\u0435\u043b\u0435\u0442\u0430, \u043d\u0430\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0442\u044f\u043d\u0443\u043b \u0442\u043a\u0430\u043d\u044c (\u043a\u0430\u043a\u00a0\u0436\u0435 \u0441\u00a0\u043d\u0435\u0439 \u0432\u0435\u0441\u0435\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c\u00a0\u2014 <s>\u043d\u0435\u0442<\/s>), \u0442.\u043a. \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u043e\u043f\u044b\u0442 \u043f\u0440\u043e\u0448\u0443 \u043d\u0435\u00a0\u0441\u0443\u0434\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u0433\u043e)<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041c\u043e\u0434\u0435\u043b\u044c \u0432\u0440\u0430\u0433\u0430 \u0432\u00a0\u0432\u0438\u0434\u0435 \u0441\u043a\u0435\u043b\u0435\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u0411\u0435\u0437\u00a0\u0442\u043a\u0430\u043d\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u043c\u043e\u0434\u0435\u043b\u044c\u043a\u0443 \u0430\u043b\u0442\u0430\u0440\u044f \u0438 \u043a\u0443\u0431\u0438\u043a\u0430 \u043d\u0430\u00a0\u043d\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0439\u0442\u0438 \u0438\u0433\u0440\u0443<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u043a\u0438\u00a0\u0431\u044b\u043b\u0438 \u0433\u043e\u0442\u043e\u0432\u044b, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043b \u043a\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043a\u043e\u043c\u043d\u0430\u0442. \u0420\u0435\u0448\u0438\u043b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0434\u043e\u0432 \u043a\u043e\u043c\u043d\u0430\u0442 \u0438 \u043f\u0440\u0435\u0444\u0430\u0431 \u043a\u043e\u0440\u0438\u0434\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u043e\u0442\u043e\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043b 3\u00a0\u0432\u0438\u0434\u0430 \u043a\u043e\u043c\u043d\u0430\u0442, \u043d\u043e\u00a0\u043f\u043e\u0442\u043e\u043c \u0440\u0435\u0448\u0438\u043b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u00a0\u0434\u0432\u0443\u0445\u00a0\u2014 \u043f\u0443\u0441\u0442\u0430\u044f \u0438 \u0442\u0430, \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0435\u0441\u0442\u044c \u0430\u043b\u0442\u0430\u0440\u044c \u0441\u00a0\u043a\u0443\u0431\u0438\u043a\u043e\u043c.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0443\u0441\u0442\u0430\u044f \u043a\u043e\u043c\u043d\u0430\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u041a\u043e\u043c\u043d\u0430\u0442\u0430 \u0441\u00a0\u0430\u043b\u0442\u0430\u0440\u0435\u043c<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u0417\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0442\u0443\u043c\u0430\u043d \u0438 \u0444\u043e\u043d\u0430\u0440\u0438\u043a<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043b \u043a\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f\u00a0\u043a\u043e\u043c\u043d\u0430\u0442. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u0440\u043e\u0441\u0442\u00a0\u2014 \u0443\u00a0\u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u044f \u043a\u043e\u043c\u043d\u0430\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430, \u0443\u00a0\u043d\u0435\u0435 \u0435\u0441\u0442\u044c 4\u00a0\u0432\u044b\u0445\u043e\u0434\u0430, \u0437\u0430\u0434\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u043d\u0430\u0442 \u0441\u00a0\u0430\u043b\u0442\u0430\u0440\u044f\u043c\u0438 \u0438 \u043a\u043e\u043c\u043d\u0430\u0442 \u0431\u0435\u0437\u00a0\u043d\u0438\u0445, \u0437\u0430\u0442\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0435\u0437\u0430\u043d\u044f\u0442\u044b\u0439 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437\u00a0\u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0438 \u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0430\u043c \u043a\u043e\u0440\u0438\u0434\u043e\u0440, \u0430\u00a0\u043d\u0430\u00a0\u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u0440\u0438\u0434\u043e\u0440\u0430 \u043a\u043e\u043c\u043d\u0430\u0442\u0443, \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0442\u0430\u043a, \u043f\u043e\u043a\u0430 \u043d\u0435\u00a0\u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u043a\u043e\u043c\u043d\u0430\u0442\u044b.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0441\u00a0\u0430\u043b\u0442\u0430\u0440\u044f\u043c\u0438, \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u043a\u0430\u043a\u00a0\u043c\u043e\u0436\u043d\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u043e\u0442\u00a0\u0438\u0433\u0440\u043e\u043a\u0430, \u043d\u043e\u00a0\u043f\u043e\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u00a0\u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0441\u00a0\u0430\u043b\u0442\u0430\u0440\u044f\u043c\u0438 \u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u043e\u043a\u043e\u043b\u043e \u0434\u0440\u0443\u0433\u0430 \u0432\u00a0\u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0442\u0430\u043c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043d\u0435\u0437\u0430\u043d\u044f\u0442\u044b\u0435 \u0432\u044b\u0445\u043e\u0434\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430\u00a0\u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u044e \u0434\u043e\u00a0\u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0430\u043b\u0442\u0430\u0440\u044f, \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u0415\u0441\u043b\u0438 \u0432\u00a0\u043a\u043e\u043d\u0446\u0435 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0435\u0437\u0430\u043d\u044f\u0442\u044b\u0435 \u0432\u044b\u0445\u043e\u0434\u044b, \u0442\u043e \u043e\u043d\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u0442\u0435\u043d\u043e\u0439, \u0438\u0437\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043a\u043e\u043c\u043d\u0430\u0442\u0430.<\/p>\n<p>\u0412\u00a0\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441\u00a0\u0431\u0430\u0433\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u00a0\u0441\u043c\u043e\u0433 \u0440\u0435\u0448\u0438\u0442\u044c, \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c \u043e\u0431\u0434\u0443\u043c\u044b\u0432\u0430\u043b \u043a\u0430\u043a\u00a0\u043c\u043e\u0436\u043d\u043e\u00a0\u0431\u044b\u043b\u043e\u00a0\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u043e\u0439 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0435\u0433\u043e, \u043d\u0430\u00a0\u0431\u0443\u0434\u0443\u0449\u0435\u0435 \u0431\u0443\u0434\u0443 \u0437\u043d\u0430\u0442\u044c. \u0411\u0430\u0433 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0441\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u043a\u043e\u043c\u043d\u0430\u0442\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u0432\u00a0\u0434\u0440\u0443\u0433\u0435, \u0435\u0441\u043b\u0438 \u0434\u0432\u0435 \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0441\u0432\u043e\u0438\u043c\u0438 \u0432\u044b\u0445\u043e\u0434\u0430\u043c\u0438 \u0441\u043c\u043e\u0442\u0440\u044f\u0442 \u0434\u0440\u0443\u0433 \u043d\u0430\u00a0\u0434\u0440\u0443\u0433\u0430, \u0430\u00a0\u0437\u0430\u0442\u0435\u043c \u043e\u0431\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u0432\u043e\u0438 \u0432\u044b\u0445\u043e\u0434\u044b \u0434\u043b\u044f\u00a0\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0439 \u043a\u043e\u043c\u043d\u0430\u0442\u044b.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 1<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 2<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 <\/figcaption><\/div>\n<\/figure>\n<p><strong>\u041a\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438:<\/strong><\/p>\n<p>\u0412\u00a0\u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435 \u043d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0441\u043a\u0440\u0438\u043f\u0442, \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u00a0\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u043e\u0434\u0437\u0435\u043c\u0435\u043b\u044c\u044f, \u043e\u0441\u043e\u0431\u043e \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043b\u0443\u0447\u0448\u0435 \u043d\u0435\u00a0\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0442\u0430\u043c \u0432\u0441\u0435 \u00ab\u0442\u044f\u043f\u2011\u043b\u044f\u043f\u00bb.<\/p>\n<pre><code class=\"cs\">using Assets.Scipts; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; using static UnityEngine.GraphicsBuffer;  public class LevelGenerator : MonoBehaviour {     public GameObject CrossRoomPrefab;     public GameManager gameManager;     public GameObject AltarRoomPrefab;     public GameObject CorridorPrefab;     public GameObject EmptyRoomPrefab;     public GameObject WallExitPrefab;     public GameObject Player;     public int NumberOfRooms = 5;     public int NumberOfAltarRooms = 2;     private int AlreadyPickupedRunes = 0;     public double RadiusToCheckExistingOfAltars = 15;     public Vector3 StartPosition = Vector3.zero;     public event Action AllRunesCollectedEvent;     public event Action OneRuneCollectedEvent;      private List&lt;GameObject&gt; placedRooms = new List&lt;GameObject&gt;();     private List&lt;RoomInfo&gt; roomInfos = new List&lt;RoomInfo&gt;();     public List&lt;Vector3&gt; AltarRoomPositions = new List&lt;Vector3&gt;();      public void GenerateLevel()     {         GameObject startRoom = Instantiate(EmptyRoomPrefab, StartPosition, Quaternion.identity);         placedRooms.Add(startRoom);         roomInfos.Add(startRoom.GetComponent&lt;RoomInfo&gt;());         PlaceEmptyRooms();         PlaceAltarRooms();         CloseFreeExists();     }      RoomInfo FindFirstRoomWithFreeExit()     {         for (int i = 0; i &lt; roomInfos.Count; i++)         {             if (roomInfos[i].FreeExits.Count &gt; 0)             {                 return roomInfos[i];             }         }          return null;     }      void OccupieExit(RoomInfo roomInfo, GameObject objectToOccupie)     {         roomInfo.OccupiedExits.Add(objectToOccupie);         roomInfo.FreeExits.Remove(objectToOccupie);     }      Transform FindFarthestFreeExitFromPoint(Vector3 pos)     {         Transform farthestExit = null;         float maxDistance = float.MinValue;          for (int i = 0; i &lt; roomInfos.Count; i++)         {             for (int j = 0; j &lt; roomInfos[i].FreeExits.Count; j++)             {                 Transform freeExitTransform = roomInfos[i].FreeExits[j].transform;                 float distance = Vector3.Distance(pos, freeExitTransform.position);                 if (distance &gt; maxDistance &amp;&amp; !IsPositionTooCloseToAltarRooms(freeExitTransform.position))                 {                     maxDistance = distance;                     farthestExit = roomInfos[i].FreeExits[j].transform;                 }             }         }          return farthestExit;     }      bool IsPositionTooCloseToAltarRooms(Vector3 position)     {         foreach (Vector3 altarPosition in AltarRoomPositions)         {             if (Vector3.Distance(position, altarPosition) &lt; RadiusToCheckExistingOfAltars)             {                 return true;             }         }         return false;     }      void PlaceEmptyRooms()     {         for (int i = 0; i &lt; NumberOfRooms; i++)         {             Transform oldExit = FindFirstRandomRoomWithFreeExit();              if (oldExit == null)             {                 break;             }              Transform corridorExit;              PlaceCorridor(oldExit, out corridorExit);              GameObject newRoom = Instantiate(EmptyRoomPrefab);             Transform newRoomEntrance = newRoom.GetComponent&lt;RoomInfo&gt;().FreeExits.First().transform;             Quaternion roomRotation = Quaternion.FromToRotation(-newRoomEntrance.forward, corridorExit.forward);             newRoom.transform.rotation = roomRotation;             newRoom.transform.position = corridorExit.position - (newRoom.transform.rotation * newRoomEntrance.localPosition);              RoomInfo newRoomInfo = newRoom.GetComponent&lt;RoomInfo&gt;();             placedRooms.Add(newRoom);             roomInfos.Add(newRoomInfo);             OccupieExit(newRoomInfo, newRoomEntrance.gameObject);             OccupieExit(corridorExit.GetComponentInParent&lt;RoomInfo&gt;(), corridorExit.gameObject);         }     }     void PlaceAltarRooms()     {         for (int i = 0; i &lt; NumberOfAltarRooms; i++)         {             Transform farthestExit = FindFarthestFreeExitFromPoint(Vector3.zero);              if (farthestExit == null)             {                 Debug.LogWarning(\"\u041d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432\u044b\u0445\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043d\u0430\u0442\u044b \u0441 \u0430\u043b\u0442\u0430\u0440\u0451\u043c.\");                 break;             }              Transform corridorExit;              PlaceCorridor(farthestExit, out corridorExit);              Transform newRoomEntrance = AltarRoomPrefab.GetComponent&lt;RoomInfo&gt;().FreeExits.First().transform;             Quaternion rotationDifference = Quaternion.FromToRotation(-newRoomEntrance.forward, corridorExit.forward);             Vector3 newPosition = corridorExit.position - (rotationDifference * newRoomEntrance.localPosition);              GameObject newRoom = Instantiate(AltarRoomPrefab, newPosition, rotationDifference * AltarRoomPrefab.transform.rotation);             RoomInfo newRoomInfo = newRoom.GetComponent&lt;RoomInfo&gt;();              placedRooms.Add(newRoom);             roomInfos.Add(newRoomInfo);             AltarRoomPositions.Add(newPosition);             \/\/OccupieExit(newRoomInfo, newRoomEntrance.gameObject);             OccupieExit(newRoomInfo, newRoom.GetComponent&lt;RoomInfo&gt;().FreeExits.First().transform.gameObject);             OccupieExit(corridorExit.GetComponentInParent&lt;RoomInfo&gt;(), corridorExit.gameObject);         }     }      void PlaceCorridor(Transform startPosition, out Transform otherExitFromCorridor)     {         GameObject corridor = Instantiate(CorridorPrefab);         Transform corridorEntrance = corridor.GetComponent&lt;RoomInfo&gt;().FreeExits.First().transform;         Quaternion corridorRotation = Quaternion.FromToRotation(-corridorEntrance.forward, startPosition.forward);         corridor.transform.rotation = corridorRotation;         corridor.transform.position = startPosition.position - (corridor.transform.rotation * corridorEntrance.localPosition);          RoomInfo corridorInfo = corridor.GetComponent&lt;RoomInfo&gt;();         placedRooms.Add(corridor);         roomInfos.Add(corridorInfo);         OccupieExit(corridorInfo, corridorEntrance.gameObject);         OccupieExit(startPosition.GetComponentInParent&lt;RoomInfo&gt;(), startPosition.gameObject);          Transform corridorExit = corridorInfo.FreeExits.First().transform;          otherExitFromCorridor = corridorExit;     }      Transform FindFirstRandomRoomWithFreeExit()     {         List&lt;GameObject&gt; exits = new List&lt;GameObject&gt;();         exits = roomInfos.Where(x =&gt; x.FreeExits.Count &gt; 0).SelectMany(x =&gt; x.FreeExits).ToList();         if (exits.Count != 0)         {             System.Random rnd = new System.Random();             return exits.ElementAt(rnd.Next(exits.Count)).transform;         }          return null;     }      void<\/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-463598","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/463598","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=463598"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/463598\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=463598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=463598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=463598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}