{"id":286585,"date":"2017-05-19T10:20:02","date_gmt":"2017-05-19T06:20:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=286585"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=286585","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0433\u0440\u044b Match-3 \u0432 Unity"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f26\/d81\/ec1\/f26d81ec11b30fcd762bf4fde2b1cc3e.png\" alt=\"image\"\/><\/p>\n<p>  \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u043d\u0430 <a href=\"http:\/\/seishun-con.com\/\">SeishunCon<\/a> \u044f \u0437\u0430\u043d\u043e\u0432\u043e \u043e\u0442\u043a\u0440\u044b\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0438\u0433\u0440\u044b match-3. \u042f \u0438\u0433\u0440\u0430\u043b \u0432 Dr. Mario \u0434\u0435\u0442\u0441\u0442\u0432\u0435, \u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u0433\u0440\u044b, \u043a\u0430\u043a <em>Magical Drop<\/em>, <em>Bust-A-Move<\/em> \u0438 <em>Tokimeki Memorial Taisen Puzzle-Dama<\/em>, \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u043d\u0435\u0451.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/7ef\/4eb\/5c0\/7ef4eb5c05fa00f48d0ae41c96f62eff.gif\" alt=\"image\"\/><br \/>  <i>Dr. Mario<\/i><\/p>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044f \u043e\u0441\u043e\u0437\u043d\u0430\u043b, \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0438\u0433\u0440\u044b match-3.<\/p>\n<p>  \u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0434\u0436\u0435\u043c\u0435 Ludum Dare \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430 \u043d\u0435\u0434\u0435\u043b\u044e \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u043e\u0433\u0440\u0435\u0432\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u00ab\u0422\u0435\u0442\u0440\u0438\u0441\u0430\u00bb, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0438 \u0443\u0434\u0430\u043b\u044f\u044e\u0449\u0438\u0439 \u043b\u0438\u043d\u0438\u0438. \u041c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433 <a href=\"http:\/\/unityplus.blogspot.com\/2014\/06\/tetris-game-tutorial-part-1.html\">\u044d\u0442\u043e\u0442 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b Unity Plus<\/a>. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u00ab\u0422\u0435\u0442\u0440\u0438\u0441\u0430\u00bb \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0432\u044b\u0438\u0441\u043a\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u044f \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0442\u0430\u0439\u043b\u043e\u0432.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435, \u0442\u043e \u0437\u0430\u0439\u0434\u0438\u0442\u0435 \u0432 \u043c\u043e\u0439 <a href=\"https:\/\/bitbucket.org\/dylanwolf\/ludumdare30\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Ludum Dare 30<\/a>. (\u0414\u043b\u044f \u0431\u0435\u0441\u0441\u0442\u044b\u0434\u043d\u043e\u0439 \u0441\u0430\u043c\u043e\u0440\u0435\u043a\u043b\u0430\u043c\u044b \u044f \u0441\u043d\u043e\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u044d\u0442\u0443 \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u043b\u044f \u0438\u0433\u0440\u044b <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.FuncWorks.ShiftyShapes\">Shifty Shapes<\/a>.)<\/p>\n<h2>\u0414\u0432\u0430 \u043c\u0438\u0440\u0430<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/699\/ac6\/54c\/699ac654cc202f5535595172e6b73f43.jpg\"\/><br \/>  <i>Magical Drop 3 (\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"http:\/\/www.neogeoforlife.com\/viewpage.php?page_id=68\">Kazuya_UK<\/a>)<\/i><\/p>\n<p>  \u0421\u0430\u043c\u0430\u044f \u043c\u0443\u0434\u0440\u0451\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u0433\u0440\u044b-\u0433\u043e\u043b\u043e\u0432\u043e\u043b\u043e\u043c\u043a\u0438 \u0432 Unity \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0433\u0440\u0430 \u043d\u0435 \u0436\u0438\u0432\u0451\u0442 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043c\u0438\u0440\u0430. \u0412\u043e \u0432\u0441\u044f\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0436\u0438\u0432\u0451\u0442 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0435\u0451 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0436\u0430\u043d\u0440\u043e\u0432. \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u0440\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0436\u0438\u0432\u0443\u0442 \u0432 \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043c\u0438\u0440\u0435 Unity. Transform \u0438\u0433\u0440\u043e\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e \u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041a\u043e\u043b\u043b\u0430\u0439\u0434\u0435\u0440\u044b (\u0438\u043b\u0438, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, raycast) \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438 \u0438\u0433\u0440\u043e\u043a \u043d\u0430 \u0437\u0435\u043c\u043b\u0435, \u0443\u0434\u0430\u0440\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043e\u0431 \u043f\u043e\u0442\u043e\u043b\u043e\u043a \u0438\u043b\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0432\u0440\u0430\u0433\u043e\u043c. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0432\u043d\u0443\u0442\u0440\u0438\u0438\u0433\u0440\u043e\u0432\u0443\u044e \u0444\u0438\u0437\u0438\u043a\u0443, \u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0441\u0438\u043b\u0443 \u0438\u043b\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c Rigidbody, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0439 \u0431\u0435\u0437 \u0437\u0430\u0442\u0440\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0418\u0433\u0440\u044b-\u0433\u043e\u043b\u043e\u0432\u043e\u043b\u043e\u043c\u043a\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u0438\u0435. \u0415\u0441\u043b\u0438 \u0432 \u0432\u0430\u0448\u0435\u0439 \u0438\u0433\u0440\u0435 \u043d\u0443\u0436\u043d\u043e \u0449\u0451\u043b\u043a\u0430\u0442\u044c \u043c\u044b\u0448\u044c\u044e, \u0442\u043e \u043e\u043d\u0430 \u043d\u0430\u0432\u0435\u0440\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043c\u0438\u0440\u0430, \u043d\u043e \u0438\u0445 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u044e\u0442 \u0432 \u044f\u0447\u0435\u0439\u043a\u0443 \u0441\u0435\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0436\u0438\u0432\u0451\u0442 \u0432 \u043a\u043e\u0434\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430: \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u0438\u0433\u0440\u044b \u043a\u0430\u043a Tetris \u0438\u043b\u0438 Dr. Mario, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0448\u044c \u043d\u0435 \u0441 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0438\u043a\u0441\u0435\u043b\u044f\u043c\u0438, \u0430 \u0441 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u0438\u043b\u0438 \u0442\u0430\u0439\u043b\u0430\u043c\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/935\/790\/d1f\/935790d1f225186b27fd8b4000863a2b.png\"\/><br \/>  <i>\u0411\u043b\u043e\u043a\u0438 \u00ab\u0422\u0435\u0442\u0440\u0438\u0441\u0430\u00bb \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0438\u043b\u0438\u043f\u0430\u0442\u044c \u043a \u0441\u0442\u0435\u043d\u043a\u0430\u043c \u0441\u0442\u0430\u043a\u0430\u043d\u0430<\/i><\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0432 \u0441\u0432\u043e\u0438\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u0445 \u044f \u0441\u0442\u0440\u0435\u043c\u0438\u043b\u0441\u044f \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043c\u0438\u0440\u0430. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0444\u0438\u0437\u0438\u043a\u0443 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u00ab\u043f\u0440\u0438\u0437\u0435\u043c\u043b\u0435\u043d\u0438\u044f\u00bb \u0442\u0430\u0439\u043b\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0434\u0432\u0443\u0445\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u0438. \u042d\u0442\u043e \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u043e\u043b\u0435\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c: \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432, \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043c\u0438\u0440\u0435 <i>\u0440\u0435\u0430\u043b\u044c\u043d\u043e<\/i>. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0432\u0438\u0434\u0438\u0442 \u0438\u0433\u0440\u043e\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0443\u0442, \u0442\u043e \u043d\u0435\u0442 \u0440\u0438\u0441\u043a\u0430 \u0440\u0430\u0441\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0440\u0430\u0432\u0434\u0430?<\/p>\n<p>  \u042f \u043e\u0448\u0438\u0431\u0430\u043b\u0441\u044f. \u041a\u0430\u043a \u0431\u044b \u044f \u043d\u0438 \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043e\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u0422\u0443\u0442\u043e\u0440\u0438\u0430\u043b Unity Plus, \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0434\u0430\u043b \u0432\u044b\u0448\u0435, \u043e\u043a\u0430\u0437\u0430\u043b \u043c\u043d\u0435 \u043e\u0433\u0440\u043e\u043c\u043d\u0443\u044e \u043f\u043e\u043c\u043e\u0449\u044c. \u041a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c, \u043e\u043d \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u043b\u043e\u0433\u0438\u043a\u0438 \u0438\u0437 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043c\u0438\u0440\u0430 \u0432 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0451 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438, \u0442\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0435\u0433\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0448\u0438\u0440\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u00ab\u0422\u0435\u0442\u0440\u0438\u0441\u0430\u00bb \u0434\u043e \u043b\u043e\u0433\u0438\u043a\u0438 match-3.<\/p>\n<h2>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 \u043f\u043e\u043b\u044f \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043c\u0438\u0440\u0430<\/h2>\n<p>  \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0443\u0434\u043e\u0431\u0435\u043d, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c. \u042f \u0441\u043e\u0437\u0434\u0430\u043b \u043a\u043b\u0430\u0441\u0441 GameTile, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0446\u0432\u0435\u0442, \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0442\u0430\u0439\u043b\u0430, \u0438 \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0430\u0439\u043b\u0430. \u0412\u043e\u0442 \u0435\u0433\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0451\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f:<\/p>\n<pre><code class=\"cs\">public class GameTile : MonoBehaviour {   private Transform _t;  private SpriteRenderer _s;   [System.NonSerialized]  public int TileColor;   [System.NonSerialized]  public int Row;   [System.NonSerialized]  public int Column;    void Awake () {    _t = GetComponent&lt;Transform&gt;();    _s = GetComponent&lt;SpriteRenderer&gt;();  }   Vector3 tmpPos;  public void UpdatePosition()  {    tmpPos = _t.position;    tmpPos.x = (Column * Board.TileSize) - Board.WorldOffset;    tmpPos.y = (Row * Board.TileSize) - Board.WorldOffset;    _t.position = tmpPos;      _s.sprite = Board.Current.Textures[TileColor];  }<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/35c\/cb5\/90a\/35ccb590aa93882cb8f187944bf7a487.png\"\/><br \/>  <i>\u0422\u0430\u0439\u043b\u044b \u0432 \u0441\u0435\u0442\u043a\u0435<\/i><\/p>\n<p>  \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 TileSize \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u0430\u0439\u043b\u0430 \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u0445 Unity. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0442\u0430\u0439\u043b\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 64\u00d764 \u043f\u0438\u043a\u0441\u0435\u043b\u044f, \u0430 \u0441\u043f\u0440\u0430\u0439\u0442 \u0432 Unity \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 100 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 TileSize \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0432\u043d\u044b\u043c 0.64. \u0422\u0430\u043a\u0436\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0430 \u043f\u043e\u043b\u044f 7\u00d77 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u0445 0,0 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043c\u0438\u0440\u0430, \u0430 \u043b\u0435\u0432\u044b\u0439 \u043d\u0438\u0436\u043d\u0438\u0439 \u0443\u0433\u043e\u043b \u044f\u0432\u043b\u044f\u043b\u0441\u044f \u0442\u0430\u0439\u043b\u043e\u043c 0, 0 \u0432 \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043c\u0430\u0441\u0441\u0438\u0432, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0438\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u043a\u0430\u043a \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 (static field) \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 Board. (Board \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u044b\u043b \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d (singleton), \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u043d\u0435\u0443\u043a\u043b\u044e\u0436\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0447\u0435\u0440\u0442\u044b \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.)<\/p>\n<pre><code class=\"cs\"> public const float TileSize = 0.64f;  public const float WorldOffset = 1.92f;   public const int BoardSize = 7;  public static GameTile[,] Tiles = new GameTile[BoardSize, BoardSize];<\/code><\/pre>\n<p>  \u0412 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 Unity Plus \u0434\u0432\u0443\u0445\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u044f \u0436\u0435 \u0440\u0435\u0448\u0438\u043b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043c\u043e\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b GameTile. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043c\u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u0442\u0430\u0439\u043b\u043e\u0432 \u0438 \u043a \u043d\u0438\u043c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e (\u043a\u0430\u043a \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043f\u043e\u0437\u0436\u0435), \u0447\u0442\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0439\u043b\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u041f\u0440\u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u0446\u0438\u043a\u043b\u043e\u043c \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u043f\u043e\u043b\u044f \u0438 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u0430\u0439\u043b\u0443, \u0433\u0434\u0435 \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f:<\/p>\n<pre><code class=\"cs\"> public static void UpdateIndexes(bool updatePositions)  {    for (int y = 0; y &lt; BoardSize; y++)    {      for (int x = 0; x &lt; BoardSize; x++)      {        if (Tiles[x,y] != null)        {          Tiles[x, y].Row = y;          Tiles[x, y].Column = x;          if (updatePositions)            Tiles[x, y].UpdatePosition();        }      }    }  }<\/code><\/pre>\n<p>  \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043c\u0438\u0440\u0430. \u0418\u0433\u0440\u043e\u0432\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b Unity \u043d\u0435 \u0445\u0440\u0430\u043d\u044f\u0442 \u0441\u0430\u043c\u0438 \u0432\u0430\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0438\u0433\u0440\u044b, \u043e\u043d\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f.<\/p>\n<h2>\u2026&nbsp;\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e<\/h2>\n<p>  \u0412 \u043c\u043e\u0435\u0439 \u0438\u0433\u0440\u0435 \u0431\u044b\u043b <em>\u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439<\/em> \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 \u043c\u0438\u0440\u0430 \u0432 \u0438\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e: \u043a\u043e\u0433\u0434\u0430 \u0438\u0433\u0440\u043e\u043a \u0449\u0451\u043b\u043a\u0430\u043b \u043c\u044b\u0448\u044c\u044e \u043d\u0430 \u043f\u0443\u0441\u0442\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u043f\u043e\u043b\u0435 \u0442\u0430\u0439\u043b. \u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u043b\u043b\u0430\u0439\u0434\u0435\u0440 \u043f\u043e\u0434 \u0432\u0441\u0435\u043c \u0438\u0433\u0440\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u0435\u043c \u0438 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u043b \u043a \u043d\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"cs\"> void OnMouseDown()  {    if (GameState.Mode == GameState.GameMode.Playing)    {      mouseClick = Camera.main.ScreenToWorldPoint(Input.mousePosition);      mouseX = (int)Mathf.Round ((mouseClick.x + WorldOffset) \/ TileSize);      mouseY = (int)Mathf.Round ((mouseClick.y + WorldOffset) \/ TileSize);      PutNextTile(mouseX, mouseY);      Soundboard.PlayDrop();      GameState.ActionsTaken++;    }  }<\/code><\/pre>\n<p>  \u0412\u043e\u0442, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438 \u0432\u0441\u0451. \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0432 \u043d\u0451\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 UpdatePosition(), \u0433\u0434\u0435 \u0438\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043c\u0438\u0440\u0430.<\/p>\n<h2>\u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0432\u043f\u0430\u0432\u0448\u0438\u0445 \u0442\u0430\u0439\u043b\u043e\u0432<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f04\/63f\/8e3\/f0463f8e3df611a13b49d5e1b4f6a4ae.png\"\/><br \/>  <i>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0432\u043f\u0430\u0432\u0448\u0438\u0445 \u0442\u0430\u0439\u043b\u043e\u0432<\/i><\/p>\n<p>  \u042d\u0442\u043e \u0441\u0430\u043c\u0430\u044f \u0445\u0438\u0442\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c. \u041d\u0430\u0432\u0435\u0440\u043d\u043e, \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0434\u0438 \u044d\u0442\u043e\u0433\u043e \u0432\u044b \u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0441\u0442\u0430\u0442\u044c\u044e.<\/p>\n<p>  \u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 (\u043a\u0430\u043a \u0432 \u00ab\u0422\u0435\u0442\u0440\u0438\u0441\u0435\u00bb) \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e: \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043c\u0435\u0436\u043d\u044b\u0435 \u0442\u0430\u0439\u043b\u044b \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435. \u0414\u0430\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 <em>\u0438\u043b\u0438<\/em> \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439 (\u043a\u0430\u043a \u0432 Dr. Mario) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0435\u0439 \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0431\u043e\u0440\u0430 \u0441\u043c\u0435\u0436\u043d\u044b\u0445 \u0442\u0430\u0439\u043b\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u043c <em>\u0438<\/em> \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438.<\/p>\n<p>  \u041f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438, \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0449\u0435\u043c \u0438\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435, \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443. \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u2014 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0432\u0435\u0441\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u043e\u043b\u044f \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432:<\/p>\n<pre><code class=\"cs\"> static void CopyBoard(GameTile[,] source, GameTile[,] destination)  {    for (int y = 0; y &lt; BoardSize; y++)    {      for (int x = 0; x &lt; BoardSize; x++)      {        destination[x, y] = source[x, y];      }    }  }   static bool clearedTiles = false;  public static void MatchAndClear(GameTile[,] board)  {    clearedTiles = false;    \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043a\u043e\u043f\u0438\u044e \u043f\u043e\u043b\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438    CopyBoard(board, toTest);  \/\/ \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u043d\u0438\u0436\u0435...<\/code><\/pre>\n<p>  \u0417\u0430\u0447\u0435\u043c? \u041c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u043f\u043e\u0437\u0436\u0435, \u0447\u0442\u043e \u0442\u0430\u043a \u0431\u0443\u0434\u0435\u0442 <em>\u0433\u043e\u0440\u0430\u0437\u0434\u043e<\/em> \u043f\u0440\u043e\u0449\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0442\u0430\u0439\u043b\u044b \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438.<\/p>\n<p>  \u041c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441 \u00ab\u0433\u0440\u0443\u0431\u043e\u0433\u043e\u00bb \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430. \u041f\u0440\u043e\u0439\u0434\u0451\u043c \u043e\u0442 \u044f\u0447\u0435\u0439\u043a\u0438 \u043a \u044f\u0447\u0435\u0439\u043a\u0435 (\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0440\u043e\u043a\u0438, \u043f\u043e\u0442\u043e\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u044b), \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f \u043a\u0430\u0436\u0434\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u044b \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e (\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0437\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0434\u043b\u044f \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438):<\/p>\n<pre><code class=\"cs\">\/\/ \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 MatchAndClear()...     currentTile = null;    collector.Clear ();     for (int y = 0; y &lt; BoardSize; y++)    {      for (int x = 0; x &lt; BoardSize; x++)      {         TestTile (x, y);  \/\/ \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u043d\u0438\u0436\u0435...<\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e TestTile:<\/p>\n<pre><code class=\"cs\"> static void TestTile(int x, int y)  {    \/\/ \u0422\u0430\u0439\u043b \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c    if (toTest[x,y] == null)    {      return;    }    \/\/ \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0431\u043b\u043e\u043a    if (currentTile == null)    {      currentTile = toTest[x, y];      toTest[x, y] = null;      collector.Add(currentTile);    }  \/\/ ** \u041f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 - \u043c\u044b \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043d\u0438\u043c \u043f\u043e\u0437\u0436\u0435 **   \/\/ \u0415\u0441\u043b\u0438 \u043c\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0442\u0430\u0439\u043b, \u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432\u0441\u0435 \u0442\u0430\u0439\u043b\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435\u0433\u043e    if (x &gt; 0)      TestTile(x - 1, y);    if (y &gt; 0)      TestTile(x, y - 1);    if (x &lt; Board.BoardSize - 1)      TestTile(x + 1, y);    if (y &lt; Board.BoardSize - 1)      TestTile(x, y + 1);  }<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u044f\u0447\u0435\u0439\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 null, \u0442\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0435\u0451. \u042f\u0447\u0435\u0439\u043a\u0430 \u0441 null \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d\u0430 \u0438\u043b\u0438 \u043f\u0443\u0441\u0442\u0430, \u0438\u043b\u0438 \u043c\u044b \u0443\u0436\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0435\u0451. (\u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0435\u0451 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u2014 \u0442\u0430\u043a \u043f\u0440\u043e\u0449\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c.)<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u044f\u0447\u0435\u0439\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u044b \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0435\u0451 \u043a\u0430\u043a \u00ab\u0442\u0435\u043a\u0443\u0449\u0443\u044e\u00bb \u044f\u0447\u0435\u0439\u043a\u0443, \u0442\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0438. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0435\u0451 \u0438\u0437 \u043a\u043e\u043f\u0438\u0438 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0434\u0432\u0430\u0436\u0434\u044b. \u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0451 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a (List), \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043c\u0435\u0436\u043d\u044b\u0445 \u0442\u0430\u0439\u043b\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u043c\u044b \u043d\u0430\u0448\u043b\u0438.<\/p>\n<p>  \u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u0432 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438, \u043d\u043e \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043d\u0438\u0445 \u043f\u043e\u0442\u043e\u043c. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0432 \u044f\u0447\u0435\u0439\u043a\u0443, \u043c\u044b \u0431\u0435\u0440\u0451\u043c \u0447\u0435\u0442\u044b\u0440\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435\u0451 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0434\u043b\u044f \u043d\u0438\u0445 \u0442\u0443 \u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443.<\/p>\n<p>  \u00ab\u0422\u0435\u043a\u0443\u0449\u0430\u044f\u00bb \u044f\u0447\u0435\u0439\u043a\u0430 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430, \u0438 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438. \u0412 \u044d\u0442\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u0430\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438.<\/p>\n<p>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u044f\u0447\u0435\u0439\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c null, \u0438 \u044d\u0442\u043e \u0441\u043d\u043e\u0432\u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043c\u044b \u0443\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 \u0435\u0451, \u0438\u043b\u0438 \u043e\u043d\u0430 \u043f\u0443\u0441\u0442\u0430. \u0418 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0441\u043d\u043e\u0432\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c.<\/p>\n<p>  \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u044f\u0447\u0435\u0439\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u00ab\u0442\u0435\u043a\u0443\u0449\u0435\u0439\u00bb \u044f\u0447\u0435\u0439\u043a\u043e\u0439. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0435\u0451 \u00ab\u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0439\u00bb. \u041d\u0430\u0448\u0430 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 \u0441\u043c\u0435\u0436\u043d\u044b\u0445 \u0442\u0430\u0439\u043b\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430. \u0422\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0442\u0430\u0439\u043b \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430, \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u043a\u0430\u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0433\u043e\u0433\u043e.<\/p>\n<pre><code class=\"cs\">\/\/ \u0418\u0437 TestTile() \u0432\u044b\u0448\u0435...    \/\/ \u0422\u0430\u0439\u043b \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c  else if (currentTile.TileColor != toTest[x, y].TileColor)  {    return;  }<\/code><\/pre>\n<p>  \u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u044f\u0447\u0435\u0439\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u0433\u043e \u0436\u0435 \u0446\u0432\u0435\u0442\u0430, \u0447\u0442\u043e \u0438 \u00ab\u0442\u0435\u043a\u0443\u0449\u0430\u044f\u00bb \u044f\u0447\u0435\u0439\u043a\u0430. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043e\u043d\u0430 \u00ab\u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u0430\u00bb, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 null \u0432 \u043a\u043e\u043f\u0438\u0438 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0451 \u0432 List, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u0430\u043a \u043d\u0430\u043a\u043e\u043f\u0438\u0442\u0435\u043b\u044c. \u042d\u0442\u043e \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435:<\/p>\n<pre><code class=\"cs\">\/\/ \u0418\u0437 TestTile() \u0432\u044b\u0448\u0435...    \/\/ \u0422\u0430\u0439\u043b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442  else  {    collector.Add(toTest[x, y]);    toTest[x, y] = null;  }<\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044e, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0430\u0442\u0441\u044f \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u0434\u043e\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044c \u0438\u043b\u0438 \u0434\u043e \u043f\u0443\u0441\u0442\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438, \u0438\u043b\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u043f\u043e\u043b\u044f. \u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0446\u0438\u043a\u043b \u0433\u0440\u0443\u0431\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432 \u043d\u0430\u043a\u043e\u043f\u0438\u0442\u0435\u043b\u0435 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u0440\u0451\u0445 \u0442\u0430\u0439\u043b\u043e\u0432, \u0442\u043e \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u0434\u0432\u0430 \u0442\u0430\u0439\u043b\u0430, \u043d\u043e \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439:<\/p>\n<pre><code class=\"cs\">\/\/ \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 MatchAndClear() \u0432\u044b\u0448\u0435...         if (collector.Count &gt;= 3)        {          foreach (GameTile tile in collector)          {            ClearTile(tile.Column, tile.Row);            clearedTiles = true;            Soundboard.PlayClear();          }        }        currentTile = null;        collector.Clear ();      }    }     if (clearedTiles)    {      SettleBlocks(board)    }  }<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c, \u043a\u0430\u043a \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0437\u0436\u0435, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u044e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e. \u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043e\u0434\u043d\u0430\u043a\u043e, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0439\u0442\u0438 \u0446\u0438\u043a\u043b\u043e\u043c \u043f\u043e \u043d\u0430\u0448\u0435\u043c\u0443 \u043d\u0430\u043a\u043e\u043f\u0438\u0442\u0435\u043b\u044e \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c DestroyObject \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0433\u043e \u0442\u0430\u0439\u043b\u0430. \u0422\u0430\u043a \u043c\u044b \u0443\u0431\u044c\u0451\u043c \u0434\u0432\u0443\u0445 \u0437\u0430\u0439\u0446\u0435\u0432 \u043e\u0434\u043d\u0438\u043c \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u043c: \u0438\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f \u043e\u0442 \u0432\u043d\u0443\u0442\u0440\u0438\u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043c \u044f\u0447\u0435\u0439\u043a\u0430\u043c \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 null.<\/p>\n<h2>\u041f\u0430\u0434\u0435\u043d\u0438\u0435 \u0442\u0430\u0439\u043b\u043e\u0432<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f26\/d81\/ec1\/f26d81ec11b30fcd762bf4fde2b1cc3e.png\"\/><br \/>  <i>\u041f\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u0442\u0430\u0439\u043b<\/i><\/p>\n<p>  \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0442\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0439\u043b\u043e\u0432, \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0442\u0430\u0439\u043b\u044b \u0431\u0435\u0437 \u043e\u043f\u043e\u0440\u044b, \u0438 \u044d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c (\u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0432\u0430\u0448\u0435\u0439 \u0438\u0433\u0440\u044b). \u0418 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0437\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u043c, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0437\u0430 \u0441\u0442\u0440\u043e\u043a\u043e\u0439. \u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u0435\u043d.<\/p>\n<p>  \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u043c\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0441\u043d\u0438\u0437\u0443 \u0432\u0432\u0435\u0440\u0445, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u0443\u0441\u0442\u0443\u044e \u044f\u0447\u0435\u0439\u043a\u0443. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u043c \u0435\u0451. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0439 \u0442\u0430\u0439\u043b \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043c\u0435\u0449\u0430\u0435\u043c \u0432\u043d\u0438\u0437, \u0432 \u044d\u0442\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u043a \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u00ab\u043f\u0443\u0441\u0442\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438\u00bb:<\/p>\n<pre><code class=\"cs\"> static int? firstEmpty;  public static void SettleBlocks(GameTile[,] board)  {    for (int x = 0; x &lt; BoardSize; x++)    {      firstEmpty = null;      for (int y = 0; y &lt; BoardSize; y++)      {        if (board[x, y] == null &amp;&amp; !firstEmpty.HasValue)        {          firstEmpty = y;        }        else if (firstEmpty.HasValue &amp;&amp; board[x, y] != null)        {          board[x, firstEmpty.Value] = board[x, y];          board[x, y] = null;          firstEmpty++;        }      }    }    UpdateIndexes(false);  }<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0441\u043d\u043e\u0432\u0430 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439. \u041e\u0447\u0435\u043d\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u0442\u0430\u0439\u043b\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043f\u0443\u0441\u0442\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0435\u0441\u043b\u0438 \u0432 \u0438\u0433\u0440\u0435 \u0432\u0435\u0434\u0451\u0442\u0441\u044f \u0441\u0447\u0451\u0442, \u0442\u043e \u044d\u0442\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u0431\u043e \u0438\u043b\u0438 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0435\u0439 \u043e\u0447\u043a\u043e\u0432. \u0412\u0441\u0435 \u044d\u0442\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f \u043f\u0430\u0434\u0435\u043d\u0438\u0439 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0431\u043b\u043e\u043a\u043e\u0432 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044f\u043c\u0438 \u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0438\u0433\u0440\u043e\u043a\u0430. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0435\u0433\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u0438 \u043a\u0430\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u00ab\u0446\u0435\u043f\u043e\u0447\u0435\u043a\u00bb \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<h2>\u0410\u043d\u0438\u043c\u0430\u0446\u0438\u0438<\/h2>\n<p>  \u0418\u0433\u0440\u0430 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u043f\u043e\u043a\u0430 \u043e\u043d\u0430 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u0430 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0438\u0437-\u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439. \u0422\u0430\u0439\u043b\u044b \u0438\u0441\u0447\u0435\u0437\u0430\u044e\u0442, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u043d\u0438\u0436\u043d\u0438\u0445 \u0441\u0442\u0440\u043e\u043a\u0430\u0445. \u0421\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u042d\u0442\u043e \u0442\u043e\u0436\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u0418\u0433\u0440\u043e\u0432\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438\u0433\u0440\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u0439\u043b\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u0441\u0435\u0442\u043a\u0435. \u0422\u0430\u0439\u043b\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u0442\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e: \u0442\u0430\u0439\u043b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 1 \u0438\u043b\u0438 2, \u043d\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u2014 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 1,5.<\/p>\n<p>  \u0412 \u0447\u0451\u043c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c? \u041d\u0430\u043c \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e <em>\u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u0435\u043c<\/em> \u0438 <em>\u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0435\u0439<\/em>. \u0412\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u00ab\u0422\u0435\u0442\u0440\u0438\u0441\u00bb \u0438\u043b\u0438 Dr. Mario \u2014 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0430\u0439\u043b \u043d\u0435 \u043f\u0430\u0434\u0430\u0435\u0442, \u043f\u043e\u043a\u0430 \u0432\u0441\u0435 \u0442\u0430\u0439\u043b\u044b \u043d\u0430 \u043f\u043e\u043b\u0435 \u043d\u0435 \u00ab\u0443\u043b\u044f\u0433\u0443\u0442\u0441\u044f\u00bb. \u042d\u0442\u043e \u0434\u0430\u0451\u0442 \u0438\u0433\u0440\u043e\u043a\u0443 \u043a\u043e\u0440\u043e\u0442\u043a\u0443\u044e \u043f\u0435\u0440\u0435\u0434\u044b\u0448\u043a\u0443, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439.<\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u043f\u0440\u0438 \u043d\u0430\u0447\u0430\u043b\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 (enumeration) \u00ab\u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439\u00bb. \u041c\u043d\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0433\u0440\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u043d\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438\u0433\u0440\u044b: \u0441\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u0433\u0440\u044b, \u043f\u0430\u0443\u0437\u0430, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044e, \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043d\u0430 \u0440\u0430\u043d\u043d\u0438\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b <em>\u043a\u0430\u0436\u0434\u0430\u044f<\/em> \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0432\u0430\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0430, \u0434\u043e\u043b\u0436\u043d\u0430 \u043b\u0438 \u043e\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.<\/p>\n<p>  \u041f\u0440\u0438\u0437\u043d\u0430\u044e\u0441\u044c, \u0447\u0442\u043e \u043c\u043e\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435\u0443\u043a\u043b\u044e\u0436\u0430, \u043d\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u0438\u0434\u0435\u044f \u0442\u0430\u043a\u043e\u0432\u0430: \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0438\u043b\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0442\u0430\u0439\u043b\u0430 \u043c\u044b \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u041a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 GameTile \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0438, \u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u043e, \u0437\u043d\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u0432\u043e\u043c\u0443 \u043f\u043e\u043b\u044e, \u0447\u0442\u043e \u043e\u043d \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b \u0441\u0432\u043e\u044e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"cs\"> void Update () {    if (GameState.Mode == GameState.GameMode.Falling &amp;&amp; Row != LastRow)    {      targetY = (Row * Board.TileSize) - Board.WorldOffset;       tmpPos = _t.position;      tmpPos.y -= FallSpeed * Time.deltaTime;      if (tmpPos.y &lt;= targetY)      {        Board.fallingBlocks.Remove(this);        UpdatePosition();        Soundboard.PlayDrop();      }    }  }<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0438\u0433\u0440\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0442\u0430\u0439\u043b\u043e\u0432:<\/p>\n<pre><code class=\"cs\"> private static float timer;  private const float DisappearTimer = 0.667f;  void Update()  {    if (GameState.Mode == GameState.GameMode.Disappearing)    {      timer -= Time.deltaTime;      if (timer &lt;= 0)      {        GameState.Mode = GameState.GameMode.Playing;        SettleBlocks(Tiles);      }    }<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439:<\/p>\n<pre><code class=\"cs\">   if (GameState.Mode == GameState.GameMode.Falling &amp;&amp; fallingBlocks.Count == 0)    {      GameState.Mode = GameState.GameMode.Playing;      MatchAndClear(Tiles);    }  }<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0446\u0438\u043a\u043b \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f, \u043f\u043e\u043a\u0430 \u0443 \u043d\u0430\u0441 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0439, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0438\u0433\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435.<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:\/\/habrahabr.ru\/post\/329016\/\"> https:\/\/habrahabr.ru\/post\/329016\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f26\/d81\/ec1\/f26d81ec11b30fcd762bf4fde2b1cc3e.png\" alt=\"image\"\/><\/p>\n<p>  \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u043d\u0430 <a href=\"http:\/\/seishun-con.com\/\">SeishunCon<\/a> \u044f \u0437\u0430\u043d\u043e\u0432\u043e \u043e\u0442\u043a\u0440\u044b\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0438\u0433\u0440\u044b match-3. \u042f \u0438\u0433\u0440\u0430\u043b \u0432 Dr. Mario \u0434\u0435\u0442\u0441\u0442\u0432\u0435, \u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u0433\u0440\u044b, \u043a\u0430\u043a <em>Magical Drop<\/em>, <em>Bust-A-Move<\/em> \u0438 <em>Tokimeki Memorial Taisen Puzzle-Dama<\/em>, \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u043d\u0435\u0451.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/7ef\/4eb\/5c0\/7ef4eb5c05fa00f48d0ae41c96f62eff.gif\" alt=\"image\"\/><br \/>  <i>Dr. Mario<\/i><\/p>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044f \u043e\u0441\u043e\u0437\u043d\u0430\u043b, \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0438\u0433\u0440\u044b match-3.<\/p>\n<p>  \u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0434\u0436\u0435\u043c\u0435 Ludum Dare \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430 \u043d\u0435\u0434\u0435\u043b\u044e \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u043e\u0433\u0440\u0435\u0432\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u00ab\u0422\u0435\u0442\u0440\u0438\u0441\u0430\u00bb, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0438 \u0443\u0434\u0430\u043b\u044f\u044e\u0449\u0438\u0439 \u043b\u0438\u043d\u0438\u0438. \u041c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433 <a href=\"http:\/\/unityplus.blogspot.com\/2014\/06\/tetris-game-tutorial-part-1.html\">\u044d\u0442\u043e\u0442 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b Unity Plus<\/a>. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u00ab\u0422\u0435\u0442\u0440\u0438\u0441\u0430\u00bb \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0445 \u0440\u044f\u0434\u043e\u0432 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0432\u044b\u0438\u0441\u043a\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u044f \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0442\u0430\u0439\u043b\u043e\u0432.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435, \u0442\u043e \u0437\u0430\u0439\u0434\u0438\u0442\u0435 \u0432 \u043c\u043e\u0439 <a href=\"https:\/\/bitbucket.org\/dylanwolf\/ludumdare30\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Ludum Dare 30<\/a>. (\u0414\u043b\u044f \u0431\u0435\u0441\u0441\u0442\u044b\u0434\u043d\u043e\u0439 \u0441\u0430\u043c\u043e\u0440\u0435\u043a\u043b\u0430\u043c\u044b \u044f \u0441\u043d\u043e\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u044d\u0442\u0443 \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u043b\u044f \u0438\u0433\u0440\u044b <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.FuncWorks.ShiftyShapes\">Shifty Shapes<\/a>.)<\/p>\n<h2>\u0414\u0432\u0430 \u043c\u0438\u0440\u0430<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/699\/ac6\/54c\/699ac654cc202f5535595172e6b73f43.jpg\"\/><br \/>  <i>Magical Drop 3 (\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"http:\/\/www.neogeoforlife.com\/viewpage.php?page_id=68\">Kazuya_UK<\/a>)<\/i><\/p>\n<p>  \u0421\u0430\u043c\u0430\u044f \u043c\u0443\u0434\u0440\u0451\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u0433\u0440\u044b-\u0433\u043e\u043b\u043e\u0432\u043e\u043b\u043e\u043c\u043a\u0438 \u0432 Unity \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0433\u0440\u0430 \u043d\u0435 \u0436\u0438\u0432\u0451\u0442 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043c\u0438\u0440\u0430. \u0412\u043e \u0432\u0441\u044f\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0436\u0438\u0432\u0451\u0442 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0435\u0451 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0436\u0430\u043d\u0440\u043e\u0432. \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u0440\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0436\u0438\u0432\u0443\u0442 \u0432 \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u043c\u0438\u0440\u0435 Unity. Transform \u0438\u0433\u0440\u043e\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043e \u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041a\u043e\u043b\u043b\u0430\u0439\u0434\u0435\u0440\u044b (\u0438\u043b\u0438, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, raycast) \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438 \u0438\u0433\u0440\u043e\u043a \u043d\u0430 \u0437\u0435\u043c\u043b\u0435, \u0443\u0434\u0430\u0440\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043e\u0431 \u043f\u043e\u0442\u043e\u043b\u043e\u043a \u0438\u043b\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0432\u0440\u0430\u0433\u043e\u043c. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0432\u043d\u0443\u0442\u0440\u0438\u0438\u0433\u0440\u043e\u0432\u0443\u044e \u0444\u0438\u0437\u0438\u043a\u0443, \u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0441\u0438\u043b\u0443 \u0438\u043b\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c Rigidbody, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0439 \u0431\u0435\u0437 \u0437\u0430\u0442\u0440\u0430\u0442.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-286585","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286585","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=286585"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286585\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=286585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=286585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=286585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}