{"id":321558,"date":"2021-04-16T15:00:09","date_gmt":"2021-04-16T15:00:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=321558"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=321558","title":{"rendered":"\u0421\u0443\u0434\u043d\u043e \u043d\u0430 \u0432\u043e\u0437\u0434\u0443\u0448\u043d\u043e\u0439 \u043f\u043e\u0434\u0443\u0448\u043a\u0435 \u043d\u0430 Unity 3D"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h2>\u0423\u0447\u0435\u0431\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u0434\u043b\u044f \u0448\u043a\u043e\u043b\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0427\u0430\u0441\u0442\u044c&nbsp;14<\/h2>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0443\u0440\u043e\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c:<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/535916\/\" rel=\"noopener noreferrer nofollow\">Spaceship<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/536204\/\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043c\u0438\u043d\u043e<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/536658\/\" rel=\"noopener noreferrer nofollow\">Flappy Bird<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/537580\/\" rel=\"noopener noreferrer nofollow\">\u0413\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u043d\u0430\u0442\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/537586\/\" rel=\"noopener noreferrer nofollow\">\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u0440<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/538874\/\" rel=\"noopener noreferrer nofollow\">\u0414\u0435\u0440\u0435\u0432\u044c\u044f (\u043f\u043b\u0430\u0433\u0438\u043d SpeedTree)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/538878\/\" rel=\"noopener noreferrer nofollow\">\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u043c\u0430 \u0432 SketchUp<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/538910\/\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043c \u0432 \u043b\u0435\u0441\u0443<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/540146\/\" rel=\"noopener noreferrer nofollow\">\u042d\u0444\u0444\u0435\u043a\u0442 \u0434\u043e\u0436\u0434\u044f. \u0427\u0430\u0441\u0442\u0438\u0446\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/540186\/\" rel=\"noopener noreferrer nofollow\">\u0411\u0438\u043b\u044c\u044f\u0440\u0434<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/540274\/\" rel=\"noopener noreferrer nofollow\">\u0416\u0438\u0434\u043a\u0438\u0439 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/541868\/\" rel=\"noopener noreferrer nofollow\">\u0421\u0442\u0438\u043a\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Event System<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/551516\/\" rel=\"noopener noreferrer nofollow\">\u0421\u0438\u043d\u0442\u0435\u0437\u0430\u0442\u043e\u0440 \u043d\u0430 Unity 3D<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u043e\u0442\u0434\u044b\u0445 \u0438 \u0440\u0430\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f! \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u044d\u0442\u043e\u0442 \u0443\u0440\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 &#171;\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439&#187;. \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0439 (\u043d\u043e \u0432\u0430\u0441 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432 \u043f\u0440\u0430\u0432\u0435 \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442), \u0443\u0434\u0435\u043b\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0444\u0438\u0437\u0438\u043a\u043e\u0438\u0306, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0443\u0434\u043d\u0430 \u043d\u0430 \u0432\u043e\u0437\u0434\u0443\u0448\u043d\u043e\u0438\u0306 \u043f\u043e\u0434\u0443\u0448\u043a\u0435.  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1f4\/fe0\/dd1\/1f4fe0dd12ce0cc7d6faf0a76ff4e8b3.png\" width=\"801\" height=\"477\"><figcaption><\/figcaption><\/figure>\n<h2>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0438\u0306 \u043f\u0440\u043e\u0435\u043a\u0442, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0438\u0306 <a href=\"https:\/\/disk.yandex.ru\/d\/7q0J8iYpzh-geQ?w=1\" rel=\"noopener noreferrer nofollow\">\u0430\u0441\u0441\u0435\u0442<\/a>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0430\u0441\u0441\u0435\u0442\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u0437\u0432\u0443\u043a \u0438 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0441\u0446\u0435\u043d\u0430. <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c &#8212; \u044d\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u0441\u0446\u0435\u043d\u0443 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u0430\u0440\u0442\u044b \u0438 \u0421\u0412\u041f, \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0441 \u043d\u0443\u043b\u0435\u0432\u044b\u043c \u0442\u0440\u0435\u043d\u0438\u0435\u043c \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u044e\u0431\u043a\u0435 \u0421\u0412\u041f <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/54d\/07e\/956\/54d07e9569069f81ddc49fe7556357db.png\" width=\"584\" height=\"192\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e \u0441\u0443\u0434\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Rigidbody \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a89\/da0\/9d1\/a89da09d1395d2c9c4cc59ee5571368f.png\" width=\"801\" height=\"477\"><figcaption><\/figcaption><\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2c8\/8d4\/cd4\/2c88d4cd42d145b485816f2989a0c901.png\" width=\"484\" height=\"764\"><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0430 \u043a\u043e\u043b\u043b\u0430\u0438\u0306\u0434\u0435\u0440\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0433\u0430\u043b\u043e\u0447\u043a\u0430 Convex, \u0430 Rigidbody \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u0438. \u0412\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0435\u0308 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f ConstantForce \u0441 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0432\u043d\u0438\u0437. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e90\/809\/3a9\/e908093a928dc75f1ebe09cd5754e1d0.png\" width=\"806\" height=\"480\"><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5e2\/554\/177\/5e25541778f87f74c06f61c7a134b01f.png\" width=\"533\" height=\"874\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u0443\u0436\u0435 \u043d\u0430\u043b\u043e\u0436\u0435\u043d \u0441\u043a\u0440\u0438\u043f\u0442. \u041d\u043e \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u043d\u0435\u043c\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0443\u043b\u0435\u0432\u044b\u0435 \u043b\u043e\u043f\u0430\u0442\u043a\u0438.<br \/>\u0422\u0430\u043a\u0436\u0435, \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u0442\u043e\u0447\u043a\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0440\u0443\u043b\u0435\u0432\u044b\u0445 \u043b\u043e\u043f\u0430\u0442\u043e\u043a, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043f\u0443\u0441\u0442\u044b\u0435 \u0433\u0435\u0438\u0306\u043c-\u043e\u0431\u0434\u0436\u0435\u043a\u0442\u044b \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Gizmo, \u0432 \u043d\u0438\u0445 \u0438 \u0443\u043b\u043e\u0436\u0435\u043d\u044b \u0441\u0430\u043c\u0438 \u043b\u043e\u043f\u0430\u0442\u043a\u0438. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9e4\/51f\/f58\/9e451ff585d834585548cec5e6471fb5.png\" width=\"923\" height=\"552\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u043e\u0437\u0430\u043f\u0440\u043e\u0448\u043b\u043e\u043c\u0443 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0443. \u041f\u043e\u043b\u043d\u044b\u0438\u0306 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;   public class Howercraft: MonoBehaviour {      public Rigidbody HowercraftRigidbody; \/\/ \u0440\u0438\u0434\u0436\u0438\u0442\u0431\u0430\u0434\u0438      public Transform CenterOfMass; \/\/ \u0446\u0435\u043d\u0442\u0440 \u043c\u0430\u0441\u0441     public float power = 25000; \/\/ \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u0432\u043f\u0435\u0440\u0451\u0434\/\u043d\u0430\u0437\u0430\u0434     public float torque = 25000; \/\/ \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u0432\u043b\u0435\u0432\u043e\/\u0432\u043f\u0440\u0430\u0432\u043e     float finAngle; \/\/ \u0443\u0433\u043e\u043b \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u043f\u0430\u0442\u043e\u043a      float pitch; \/\/ \u043f\u0438\u0442\u0447 \u0434\u043b\u044f \u0437\u0432\u0443\u043a\u0430     public Transform[] Fins; \/\/ \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043b\u043e\u043f\u0430\u0442\u043a\u0430\u043c\u0438     public AudioSource mainEngine; \/\/ \u0437\u0432\u0443\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f         public AudioSource pushEngine; \/\/ \u0437\u0432\u0443\u043a \u0442\u0443\u0440\u0431\u0438\u043d       \/\/ Use this for initialization      void Start() {         HowercraftRigidbody.centerOfMass = CenterOfMass.position - HowercraftRigidbody.position; \/\/ \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0446\u0435\u043d\u0442\u0440 \u043c\u0430\u0441\u0441     }       \/\/ Update is called once per frame     void Update() {                  float inpFB = Input.GetAxis(\"Vertical\"); \/\/ \u0432\u0432\u043e\u0434 \u0432\u043f\u0435\u0440\u0451\u0434\/\u043d\u0430\u0437\u0430\u0434         float inpLR = Input.GetAxis(\"Horizontal\"); \/\/ \u0438 \u0432\u043b\u0435\u0432\u043e\/\u0432\u043f\u0440\u0430\u0432\u043e                Vector3 vely = new Vector3(HowercraftRigidbody.transform.forward.x, 0, HowercraftRigidbody.transform.for ward.z); \/\/ \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0432\u0435\u043a\u0442\u043e\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0438\u043b\u044b            float gain = Mathf.Clamp01(HowercraftRigidbody.transform.up.y); \/\/ \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u0451\u0440\u043d\u0443\u0442\u044b, \u0441\u0438\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0432\u043d\u044b \u043d\u0443\u043b\u044e               HowercraftRigidbody.AddForce(vely * power * inpFB * gain, ForceMode.Force); \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u0441\u0438\u043b\u044b                HowercraftRigidbody.AddRelativeTorque(0, torque * inpLR * inpFB * gain, 0, ForceMode.Force); \/\/ \u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442                finAngle = Mathf.Lerp(finAngle, -45 * inpLR, Time.deltaTime \/ 0.2f); \/\/ \u0443\u0433\u043e\u043b \u043b\u043e\u043f\u0430\u0442\u043e\u043a              foreach(Transform Fin in Fins) {             Fin.localEulerAngles = new Vector3(0, finAngle, 0); \/\/ \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0443\u0433\u043e\u043b          }         mainEngine.pitch = 0.9f + HowercraftRigidbody.velocity.magnitude \/ 60f; \/\/\u0432\u044b\u0441\u043e\u0442\u0430 \u0437\u0432\u0443\u043a\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f                 pitch = Mathf.Lerp(pitch, Mathf.Abs(inpFB) * 1.3f, Time.deltaTime \/ 0.5f); \/\/ \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u0441\u043e\u0442\u0443 \u0437\u0432\u0443\u043a\u0430 \u0442\u0443\u0440\u0431\u0438\u043d\u044b                 pushEngine.pitch = 1f + 2f * pitch;         pushEngine.volume = 0.3f + pitch \/ 3f;     } } <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u043b\u0443\u0447\u0448\u0435 \u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0438\u0306 \u0434\u0432\u0438\u0436\u043e\u043a, \u043f\u043e\u0442\u043e\u043c \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0438\u0306.<\/p>\n<p>\u0413\u043e\u0442\u043e\u0432\u043e! <\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/552834\/\"> https:\/\/habr.com\/ru\/post\/552834\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h2>\u0423\u0447\u0435\u0431\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u0434\u043b\u044f \u0448\u043a\u043e\u043b\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0427\u0430\u0441\u0442\u044c&nbsp;14<\/h2>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0443\u0440\u043e\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c:<\/summary>\n<div class=\"spoiler__content\">\n<ol>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/535916\/\" rel=\"noopener noreferrer nofollow\">Spaceship<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/536204\/\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043c\u0438\u043d\u043e<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/536658\/\" rel=\"noopener noreferrer nofollow\">Flappy Bird<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/537580\/\" rel=\"noopener noreferrer nofollow\">\u0413\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u043d\u0430\u0442\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/537586\/\" rel=\"noopener noreferrer nofollow\">\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u0440<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/538874\/\" rel=\"noopener noreferrer nofollow\">\u0414\u0435\u0440\u0435\u0432\u044c\u044f (\u043f\u043b\u0430\u0433\u0438\u043d SpeedTree)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/538878\/\" rel=\"noopener noreferrer nofollow\">\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u043c\u0430 \u0432 SketchUp<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/538910\/\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043c \u0432 \u043b\u0435\u0441\u0443<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/540146\/\" rel=\"noopener noreferrer nofollow\">\u042d\u0444\u0444\u0435\u043a\u0442 \u0434\u043e\u0436\u0434\u044f. \u0427\u0430\u0441\u0442\u0438\u0446\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/540186\/\" rel=\"noopener noreferrer nofollow\">\u0411\u0438\u043b\u044c\u044f\u0440\u0434<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/540274\/\" rel=\"noopener noreferrer nofollow\">\u0416\u0438\u0434\u043a\u0438\u0439 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/541868\/\" rel=\"noopener noreferrer nofollow\">\u0421\u0442\u0438\u043a\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Event System<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/551516\/\" rel=\"noopener noreferrer nofollow\">\u0421\u0438\u043d\u0442\u0435\u0437\u0430\u0442\u043e\u0440 \u043d\u0430 Unity 3D<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/details>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u043e\u0442\u0434\u044b\u0445 \u0438 \u0440\u0430\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f! \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u044d\u0442\u043e\u0442 \u0443\u0440\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 &#171;\u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439&#187;. \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0439 (\u043d\u043e \u0432\u0430\u0441 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0432 \u043f\u0440\u0430\u0432\u0435 \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442), \u0443\u0434\u0435\u043b\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0444\u0438\u0437\u0438\u043a\u043e\u0438\u0306, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0443\u0434\u043d\u0430 \u043d\u0430 \u0432\u043e\u0437\u0434\u0443\u0448\u043d\u043e\u0438\u0306 \u043f\u043e\u0434\u0443\u0448\u043a\u0435.  <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0438\u0306 \u043f\u0440\u043e\u0435\u043a\u0442, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0438\u0306 <a href=\"https:\/\/disk.yandex.ru\/d\/7q0J8iYpzh-geQ?w=1\" rel=\"noopener noreferrer nofollow\">\u0430\u0441\u0441\u0435\u0442<\/a>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0430\u0441\u0441\u0435\u0442\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u0437\u0432\u0443\u043a \u0438 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0441\u0446\u0435\u043d\u0430. <\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c &#8212; \u044d\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u0441\u0446\u0435\u043d\u0443 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u0430\u0440\u0442\u044b \u0438 \u0421\u0412\u041f, \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0441 \u043d\u0443\u043b\u0435\u0432\u044b\u043c \u0442\u0440\u0435\u043d\u0438\u0435\u043c \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u044e\u0431\u043a\u0435 \u0421\u0412\u041f <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e \u0441\u0443\u0434\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Rigidbody \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043d\u0430 \u043a\u043e\u043b\u043b\u0430\u0438\u0306\u0434\u0435\u0440\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0433\u0430\u043b\u043e\u0447\u043a\u0430 Convex, \u0430 Rigidbody \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u0438. \u0412\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0435\u0308 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f ConstantForce \u0441 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0432\u043d\u0438\u0437. <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u0443\u0436\u0435 \u043d\u0430\u043b\u043e\u0436\u0435\u043d \u0441\u043a\u0440\u0438\u043f\u0442. \u041d\u043e \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u043d\u0435\u043c\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0443\u043b\u0435\u0432\u044b\u0435 \u043b\u043e\u043f\u0430\u0442\u043a\u0438.<br \/>\u0422\u0430\u043a\u0436\u0435, \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u0442\u043e\u0447\u043a\u0430\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0440\u0443\u043b\u0435\u0432\u044b\u0445 \u043b\u043e\u043f\u0430\u0442\u043e\u043a, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043f\u0443\u0441\u0442\u044b\u0435 \u0433\u0435\u0438\u0306\u043c-\u043e\u0431\u0434\u0436\u0435\u043a\u0442\u044b \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c Gizmo, \u0432 \u043d\u0438\u0445 \u0438 \u0443\u043b\u043e\u0436\u0435\u043d\u044b \u0441\u0430\u043c\u0438 \u043b\u043e\u043f\u0430\u0442\u043a\u0438. <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u043e\u0437\u0430\u043f\u0440\u043e\u0448\u043b\u043e\u043c\u0443 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0443. \u041f\u043e\u043b\u043d\u044b\u0438\u0306 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;   public class Howercraft: MonoBehaviour {      public Rigidbody HowercraftRigidbody; \/\/ \u0440\u0438\u0434\u0436\u0438\u0442\u0431\u0430\u0434\u0438      public Transform CenterOfMass; \/\/ \u0446\u0435\u043d\u0442\u0440 \u043c\u0430\u0441\u0441     public float power = 25000; \/\/ \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u0432\u043f\u0435\u0440\u0451\u0434\/\u043d\u0430\u0437\u0430\u0434     public float torque = 25000; \/\/ \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u0432\u043b\u0435\u0432\u043e\/\u0432\u043f\u0440\u0430\u0432\u043e     float finAngle; \/\/ \u0443\u0433\u043e\u043b \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u043f\u0430\u0442\u043e\u043a      float pitch; \/\/ \u043f\u0438\u0442\u0447 \u0434\u043b\u044f \u0437\u0432\u0443\u043a\u0430     public Transform[] Fins; \/\/ \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043b\u043e\u043f\u0430\u0442\u043a\u0430\u043c\u0438     public AudioSource mainEngine; \/\/ \u0437\u0432\u0443\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f         public AudioSource pushEngine; \/\/ \u0437\u0432\u0443\u043a \u0442\u0443\u0440\u0431\u0438\u043d       \/\/ Use this for initialization      void Start() {         HowercraftRigidbody.centerOfMass = CenterOfMass.position - HowercraftRigidbody.position; \/\/ \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0446\u0435\u043d\u0442\u0440 \u043c\u0430\u0441\u0441     }       \/\/ Update is called once per frame     void Update() {                  float inpFB = Input.GetAxis(\"Vertical\"); \/\/ \u0432\u0432\u043e\u0434 \u0432\u043f\u0435\u0440\u0451\u0434\/\u043d\u0430\u0437\u0430\u0434         float inpLR = Input.GetAxis(\"Horizontal\"); \/\/ \u0438 \u0432\u043b\u0435\u0432\u043e\/\u0432\u043f\u0440\u0430\u0432\u043e                Vector3 vely = new Vector3(HowercraftRigidbody.transform.forward.x, 0, HowercraftRigidbody.transform.for ward.z); \/\/ \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0432\u0435\u043a\u0442\u043e\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0438\u043b\u044b            float gain = Mathf.Clamp01(HowercraftRigidbody.transform.up.y); \/\/ \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u0451\u0440\u043d\u0443\u0442\u044b, \u0441\u0438\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0432\u043d\u044b \u043d\u0443\u043b\u044e               HowercraftRigidbody.AddForce(vely * power * inpFB * gain, ForceMode.Force); \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u0441\u0438\u043b\u044b                HowercraftRigidbody.AddRelativeTorque(0, torque * inpLR * inpFB * gain, 0, ForceMode.Force); \/\/ \u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442                finAngle = Mathf.Lerp(finAngle, -45 * inpLR, Time.deltaTime \/ 0.2f); \/\/ \u0443\u0433\u043e\u043b \u043b\u043e\u043f\u0430\u0442\u043e\u043a              foreach(Transform Fin in Fins) {             Fin.localEulerAngles = new Vector3(0, finAngle, 0); \/\/ \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0443\u0433\u043e\u043b          }         mainEngine.pitch = 0.9f + HowercraftRigidbody.velocity.magnitude \/ 60f; \/\/\u0432\u044b\u0441\u043e\u0442\u0430 \u0437\u0432\u0443\u043a\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f                 pitch = Mathf.Lerp(pitch, Mathf.Abs(inpFB) * 1.3f, Time.deltaTime \/ 0.5f); \/\/ \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u0441\u043e\u0442\u0443 \u0437\u0432\u0443\u043a\u0430 \u0442\u0443\u0440\u0431\u0438\u043d\u044b                 pushEngine.pitch = 1f + 2f * pitch;         pushEngine.volume = 0.3f + pitch \/ 3f;     } } <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u043b\u0443\u0447\u0448\u0435 \u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0438\u0306 \u0434\u0432\u0438\u0436\u043e\u043a, \u043f\u043e\u0442\u043e\u043c \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0438\u0306.<\/p>\n<p>\u0413\u043e\u0442\u043e\u0432\u043e! <\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/552834\/\"> https:\/\/habr.com\/ru\/post\/552834\/<\/a><br \/><\/br><\/br><\/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-321558","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321558","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=321558"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321558\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=321558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=321558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=321558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}