{"id":283498,"date":"2017-03-19T16:46:18","date_gmt":"2017-03-19T13:46:18","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=283498"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=283498","title":{"rendered":"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u044f\u043b\u043a\u0438 \u0434\u043b\u044f android \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 Unity3D"},"content":{"rendered":"<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/dea\/578\/b7d\/dea578b7d7d642ad9ea271c04363b1ba.png\" \/><\/div>\n<p>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a! \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0432\u043e\u0435\u0439 \u0438\u0433\u0440\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 Unity.<\/p>\n<p>  \u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u0438\u0433\u0440\u044b \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043d\u0430 \u0441\u0435\u0431\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0432\u0435\u0437\u0434\u043e\u043b\u0435\u0442\u043e\u043c \u0438 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u043e\u0432. \u041d\u0430 \u0432\u0430\u0448\u0435\u043c \u043f\u0443\u0442\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432\u0440\u0430\u0436\u0435\u0441\u043a\u0438\u0435 \u0437\u0432\u0435\u0437\u0434\u043e\u043b\u0435\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043c\u0435\u0448\u0430\u0442\u044c \u0432\u0430\u043c \u0438 \u043f\u043e\u0441\u043b\u0435 \u0438\u0445 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u00ab\u043a\u0430\u043f\u0441\u0443\u043b\u044b\u00bb \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u043e\u0440\u0443\u0436\u0438\u044f. \u0418\u0433\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f Galaxy Desteroid.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/h2>\n<p>  \u0413\u0440\u0430\u0444\u0438\u043a\u0430 \u0438\u0433\u0440\u044b \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0442\u0435\u043a\u0441\u0442\u0443\u0440:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/df5\/832\/03c\/df583203cdb54da28d32bebabbd711db.png\"\/><\/p>\n<p>  \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u0438\u0445 \u0442\u0435\u043a\u0441\u0442\u0443\u0440 \u0431\u044b\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u0444\u0430\u0431\u044b<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e8f\/da5\/e6c\/e8fda5e6ccc94d809fc011a7c07915ab.png\"\/><\/p>\n<p>  \u0433\u0434\u0435:<\/p>\n<p>  asteroidrotate \u2014 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0442\u044c<\/p>\n<p>  enemy \u2014 \u0432\u0440\u0430\u0436\u0435\u0441\u043a\u0438\u0439 \u0437\u0432\u0435\u0437\u0434\u043e\u043b\u0435\u0442<\/p>\n<p>  explosionasteroid, explosionenemy, explosionplayer \u2014 \u044d\u0442\u043e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0432\u0437\u0440\u044b\u0432\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c particle system<\/p>\n<p>  gunactivator(s) \u2014 \u044d\u0442\u043e \u043a\u0430\u043f\u0441\u0443\u043b\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0439 \u0442\u0438\u043f \u043e\u0440\u0443\u0436\u0438\u044f \u0432 \u0438\u0433\u0440\u0435<\/p>\n<p>  \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0442\u0438\u043f\u0430 laser \u0438 \u0442.\u043f. \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043e\u0440\u0443\u0436\u0438\u0435.<\/p>\n<p>  \u0418\u0433\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u044f 2 \u0441\u0446\u0435\u043d\u044b: \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u0438 \u0438\u0433\u0440\u043e\u0432\u0430\u044f \u0441\u0446\u0435\u043d\u0430.<\/p>\n<h2>\u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a1c\/984\/fec\/a1c984fec34543168ff6ecdf3dac768a.png\"\/><\/p>\n<p>  \u0413\u0434\u0435 \u00abmenu\u00bb \u044d\u0442\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u0430 \u00ab1\u00bb \u044d\u0442\u043e \u0438\u0433\u0440\u043e\u0432\u0430\u044f \u0441\u0446\u0435\u043d\u0430.<\/p>\n<p>  <img decoding=\"async\" width=\"400\" src=\"https:\/\/habrastorage.org\/files\/0e8\/90a\/7b0\/0e890a7b01fa49009d2b7151b9a0b852.png\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/bcc\/259\/cd2\/bcc259cd2a374baab828bf28fa34e22f.png\"\/><\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u043e\u043d\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u043f\u0440\u0430\u0439\u0442 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u00abspace\u00bb, \u043d\u0430 \u043d\u0435\u043c \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d \u043a\u043e\u0441\u043c\u043e\u0441.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/074\/211\/a76\/074211a76b744b539dbefd0c8b7f332e.png\"\/><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u00abmenu.cs\u00bb (\u0429\u0435\u043b\u043a\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u2192 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Create \u2192 C# Script) \u0438 \u00ab\u0432\u0435\u0448\u0430\u0435\u043c\u00bb \u0435\u0433\u043e \u043d\u0430 background. background \u044d\u0442\u043e \u0441\u043f\u0440\u0430\u0439\u0442 \u0441\u043e 100% \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f (START\/EXIT) \u0430 space \u0441\u043b\u0443\u0436\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u0434\u0435\u043a\u043e\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections; using System.Collections.Generic; using System.Runtime.Serialization.Formatters.Binary; using System.IO; using UnityEngine.SceneManagement;   public class menu : MonoBehaviour { \t \tpublic GUIStyle mystyle;\/\/\u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430\u0447\u0435\u0440\u0442\u0430\u043d\u0438\u0435 GUI \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432(\u0448\u0440\u0438\u0444\u0442, \u0440\u0430\u0437\u043c\u0435\u0440 \u0438.\u0442.\u043f.) \tstring score; \tvoid Start ()  \t{ \t\tStreamReader scoredata = new StreamReader (Application.persistentDataPath + &quot;\/score1.gd&quot;);\/\/\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \t\tscore = scoredata.ReadLine ();\/\/\u0447\u0442\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \t\tscoredata.Close ();\/\/\u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \t} \t \t\/\/ Update is called once per frame \tvoid Update () { \t \t} \tvoid OnGUI(){ \t\tGUI.Box (new Rect (Screen.width*0.15f, Screen.height*0.8f, Screen.width*0.7f, Screen.height*0.1f), &quot;MAX DESTROYED:&quot;+score,mystyle); \t\tif (GUI.Button (new Rect (Screen.width*0.15f, Screen.height*0.25f, Screen.width*0.7f, Screen.height*0.1f), &quot;START&quot;,mystyle))  \t\t{ \t\t\tSceneManager.LoadScene (1);\/\/\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0441\u0446\u0435\u043d\u044b \t\t} \t\tif (GUI.Button (new Rect (Screen.width*0.15f, Screen.height*0.4f, Screen.width*0.7f, Screen.height*0.1f), &quot;EXIT&quot;,mystyle))  \t\t{ \t\t\tApplication.Quit();\/\/\u0412\u044b\u0445\u043e\u0434 \u0438\u0437 \u0438\u0433\u0440\u044b \t\t} \t} } <\/code><\/pre>\n<p>  \u0415\u0449\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0430 \u00abspace\u00bb \u0441\u043a\u0440\u0438\u043f\u0442 activemenu. \u041e\u043d \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0444\u043e\u043d\u0430 \u043c\u0435\u043d\u044e. \u041f\u043e\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043f\u0438\u044e \u00abspace\u00bb \u0438 \u0441\u0442\u0430\u0432\u0438\u043c \u0435\u0435 \u0447\u0443\u0442\u044c \u0432\u044b\u0448\u0435.<\/p>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 activemenu:<\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;  public class activemenu : MonoBehaviour {  \tfloat speed=-0.1f; \tvoid Start () { \t \t} \t \t\/\/ Update is called once per frame \tvoid Update () { \t\ttransform.Translate (new Vector3 (0f,speed,0f)); \t\tif (transform.position.y &lt; -12f)  \t\t{ \t\t\ttransform.position=new Vector3(0f,13f,0f); \t\t} \t} }  <\/code><\/pre>\n<p>  \u0414\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/997\/7ef\/462\/9977ef4624cd4134aa46e3e4025cb3ea.gif\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e03\/3b4\/032\/e033b4032b5d47c6a469a7548b282459.png\"\/><\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0441\u0446\u0435\u043d\u044b<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c56\/5fe\/529\/c565fe529840483d9b4d5ac5a6f4c0cd.png\"\/><\/p>\n<p>  \u0418\u0433\u0440\u043e\u0432\u0430\u044f \u0441\u0446\u0435\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432:<\/p>\n<p>  \u043a\u043e\u0441\u043c\u043e\u0441 (\u0441\u043f\u0440\u0430\u0439\u0442 \u00abspace\u00bb)<br \/>  \u0438\u0433\u0440\u043e\u043a<br \/>  \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u044b<br \/>  \u0432\u0440\u0430\u0436\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u0438<br \/>  \u043f\u0440\u043e\u0447\u0435\u0435(\u043b\u0430\u0437\u0435\u0440\u044b \u0438 \u0432\u0437\u0440\u044b\u0432\u044b).<\/p>\n<p>  \u041a\u043e\u0441\u043c\u043e\u0441 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u043c\u0435\u043d\u044e. \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0442\u044c.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e \u0447\u0442\u043e \u0432 \u0438\u0433\u0440\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u043f\u0440\u0435\u0444\u0430\u0431\u043e\u0432, \u0442\u0430\u043a\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u0430\u043a \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u044b, \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u044b \u0438 \u0432\u0440\u0430\u0433\u0438. \u0418 \u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043f\u0443\u0441\u0442\u0438\u043b \u0438\u0433\u0440\u043e\u043a \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0432 \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437 \u043d\u0435 \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<p>  \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430 \u0441\u0446\u0435\u043d\u0435(\u0443 \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u00abcontrolcountobjects\u00bb), \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u043d\u0435\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 boxcollider \u0438 \u0440\u0430\u0441\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432\u043e\u043a\u0440\u0443\u0433 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0437\u043e\u043d\u044b.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/373\/2ad\/a9a\/3732ada9af3245dc8c686cc9aff7a424.png\"\/><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;  public class systemcontrolobjects : MonoBehaviour {  \tvoid Start ()  \t{ \t \t}  \tvoid Update () { \t \t} \tvoid  OnTriggerExit2D(Collider2D col) \t{ \t\tDestroy(col.gameObject); \t} } <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 box collider \u043e\u0431\u044a\u0435\u043a\u0442\u0430 controlcountobject. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043a\u0430\u044f \u0437\u043e\u043d\u0430 \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<h4>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u043e\u0432<\/h4>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 \u043a\u0430\u043c\u0435\u0440\u0443:<\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections; using System.Runtime.Serialization.Formatters.Binary; using System.IO;  public class blockgenerator : MonoBehaviour {  \tpublic GameObject asteroid;\/\/\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u044e\u0434\u0430 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442 \u0438\u0437 \u043f\u0440\u0435\u0444\u0430\u0431\u043e\u0432 \tfloat x,y,timer; \tfloat timerespawn=0.25f;\/\/\u041f\u0435\u0440\u0438\u043e\u0434 \u0432\u043e\u0437\u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u043e\u0432. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u043e\u0432. \tbool trigtime=false;\/\/\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u043e\u0442\u0441\u0447\u0435\u0442\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0415\u0441\u043b\u0438 \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 true \u0442\u043e \u0442\u043e\u0433\u0434\u0430 \u043e\u0442\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u0430. \tpublic int score;\/\/\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u043e\u0431\u0449\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043f\u043e\u0434\u0431\u0438\u0442\u044b\u0445 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u043e\u0432 \u0437\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0438\u0433\u0440\u0443 \u0438 \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u0435\u0432\u044b\u0441\u0438\u0442 \u0440\u0435\u043a\u043e\u0440\u0434 \u0442\u043e \u0442\u043e\u0433\u0434\u0430 \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0444\u0430\u0439\u043b \u0440\u0435\u043a\u043e\u0440\u0434\u0430. \u0421 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443.   \tpublic float data;   \tvoid Start ()  \t{ \t\tscore = 0;\/\/ \t\ttimer = timerespawn; \t\tStreamReader scoredata = new StreamReader (Application.persistentDataPath + &quot;\/score1.gd&quot;); \t\tdata = float.Parse(scoredata.ReadLine ()); \t\tscoredata.Close (); \t} \t\t \tvoid Update ()  \t{ \t\tif (timer==timerespawn)\/\/\u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043e\u0442\u0441\u0447\u0435\u0442\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u0430 \u0442\u043e: \t\t{ \t\t\tx = Random.Range (-2.5f, 2.5f);\/\/1)\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u0443\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442 \u0438\u0437 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430. \t\t\tInstantiate(asteroid, new Vector3(x,5.5f,-2.17f),transform.rotation);\/\/2)\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u0430 \u0438\u0437 \u043f\u0440\u0435\u0444\u0430\u0431\u0430. x \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u043e \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430. \t\t\ttrigtime = true;\/\/3)\u0410\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u043e\u0442\u0441\u0447\u0435\u0442\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432 timerrespawn \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f. \t\t} \t\tif (trigtime==true)\/\/\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f  \t\t{ \t\t\ttimer = timer-Time.deltaTime;\/\/\u041e\u0442\u0441\u0447\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0443\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u0430. \t\t} \t\tif (timer &lt; 0)\/\/\u0415\u0441\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0430 \u0438\u0441\u0442\u0435\u043a\u0430\u0435\u0442 \u0442\u043e \u0442\u043e\u0433\u0434\u0430: \t\t{ \t\t\ttimer = timerespawn;\/\/1)\u0421\u0431\u0440\u043e\u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0447\u0438\u0441\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 timerespawn \t\t\ttrigtime = false;\/\/2)\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0441\u0447\u0435\u0442\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438                         \/\/\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 &quot;\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e&quot;. \u041f\u0440\u0438 \u0438\u0445 \u0441\u0431\u0440\u043e\u0441\u0435 \u0441\u043d\u043e\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u043e\u0432 \u0438 \u043e\u0442\u0441\u0447\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0418 \u0442\u0430\u043a \u043f\u043e \u043a\u0440\u0443\u0433\u0443 \t\t} \t} } <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ecf\/cff\/b27\/ecfcffb2784a40a7ac16b9c5ddf1adec.gif\"\/><\/p>\n<h4>\u041c\u0435\u0442\u0435\u043e\u0440\u0438\u0442<\/h4>\n<p>  \u0412\u044b\u0448\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0442\u043e \u0447\u0442\u043e \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0441\u0446\u0435\u043d\u0435 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0435\u0449\u0435 \u043e\u043d\u0438 \u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f. \u042d\u0442\u043e \u0432\u0441\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0432\u0443\u0445 GameObject, \u0433\u0434\u0435 \u043e\u0434\u0438\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e (\u043c\u0430\u0442\u0440\u0435\u0448\u043a\u0430).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0be\/678\/0d5\/0be6780d50204452ac91278c4816cc47.png\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ed5\/4ee\/62b\/ed54ee62bbb94d2093984d0fe9d32e4d.png\"\/><\/p>\n<p>  \u0412\u043d\u0435\u0448\u043d\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u00abasteroidrotate\u00bb \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 circle collider \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442 \u0432\u0437\u0440\u044b\u0432\u0430, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f, \u0430 \u00abaster\u00bb \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u043e \u043f\u0440\u0438 \u0441\u0432\u043e\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0437\u043c\u0435\u0440. <\/p>\n<p>  \u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f asteroidrotate:<\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;  public class asteroidlogic : MonoBehaviour {  \tpublic GameObject explosion;\/\/\u0417\u0434\u0435\u0441\u044c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0444\u0430\u0431 \u0432\u0437\u0440\u044b\u0432\u0430 \tfloat speedasteroid=-0.1f;\/\/\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u0430  \tvoid Start ()  \t{ \t\t \t}  \tvoid Update ()  \t{ \t\ttransform.Translate (new Vector3 (0, speedasteroid, 0f));\/\/\u0414\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u0430 \u0432\u043d\u0438\u0437 \u043f\u043e \u044d\u043a\u0440\u0430\u043d\u0443 \u0441 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e  \t}  \tvoid  OnTriggerEnter2D(Collider2D col) \t{ \t\tif (col.tag == &quot;systemcontrol&quot;) \t\t{ \t\t\treturn;\/\/\u0412\u043e\u0437\u0432\u0440\u0430\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c controlcountobjects \t\t} \t\tif (col.tag == &quot;laser&quot;) \/\/\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u0432 \u0438\u0433\u0440\u043e\u043a\u0430 \u0432 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442 \t\t{ \t\t\tDestroy (col.gameObject);\/\/\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0441\u0430\u043c \u0432\u044b\u0441\u0442\u0440\u0435\u043b  \t\t\tGameObject.Find (&quot;Main Camera&quot;).GetComponent&lt;blockgenerator&gt; ().score++;\/\/\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u043a \u043e\u0431\u0449\u0435\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 \u043f\u043e\u0434\u0431\u0438\u0442\u044b\u0445 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u043e\u0432  \t\t\tInstantiate(explosion, transform.position,transform.rotation);\/\/\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0432\u0437\u0440\u044b\u0432 \u0438\u0437 \u043f\u0440\u0435\u0444\u0430\u0431\u043e\u0432 \t\t\tDestroy (this.gameObject);\/\/\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u0430 \t\t} \t} } <\/code><\/pre>\n<p>  \u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f aster:<\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;  public class rotator : MonoBehaviour {  \tint f; \tfloat sc; \tvoid Start ()  \t{ \t\tf = Random.Range (-5, 5); \t\tsc = Random.Range (0.1f,0.2f); \t\ttransform.localScale = new Vector3 (sc,sc,sc);\/\/\u0440\u0430\u0437\u043c\u0435\u0440 \t}  \tvoid Update ()  \t{ \t\ttransform.rotation *= Quaternion.AngleAxis (f,new Vector3(0,0,1));\/\/\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \t} } <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0418\u0433\u0440\u043e\u043a<\/h4>\n<p>  \u041a\u0438\u0434\u0430\u0435\u043c \u0441\u043f\u0440\u0430\u0439\u0442 \u0441 \u0437\u0432\u0435\u0437\u0434\u043e\u043b\u0435\u0442\u043e\u043c \u043d\u0430 \u0438\u0433\u0440\u043e\u0432\u0443\u044e \u0441\u0446\u0435\u043d\u0443, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 \u043d\u0435\u0433\u043e box collider(\u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u043c\u0435\u0447\u0430\u0442\u044c \u00abIs Triger\u00bb), \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c rigibody(\u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043c\u043e\u0440\u043e\u0437\u0438\u0442\u044c Y \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443). \u0412\u0441\u0435 \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u0433\u0440\u043e\u043a \u043c\u043e\u0433 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u0433\u0440\u043e\u0432\u044b\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/837\/7f9\/172\/8377f917213a48cea6477f8514a0c986.png\"\/><\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 particle system, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u044e \u0438\u0437 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/9f0\/4e8\/44c\/9f04e844c2bb48f9a05d2fbcb98100bc.png\"\/><\/p>\n<p>  \u0412 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u00ab\u0441\u0432\u044f\u0437\u0438\u00bb \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u0435\u0444\u0430\u0431\u0430\u043c\u0438 \u043a\u0430\u043a explosionplayer, laser, laser3x, laser3xhor \u0438 \u0442.\u043f. \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0434\u0431\u043e\u0440 \u00ab\u043a\u0430\u043f\u0441\u0443\u043b\u00bb \u0434\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0438\u0434\u043e\u0432 \u043e\u0440\u0443\u0436\u0438\u044f. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u0442\u0430\u043a \u0447\u0442\u043e \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0432\u0438\u0436\u0435\u0442\u0441\u044f \u0437\u0430 \u043f\u0430\u043b\u044c\u0446\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u043e\u043f\u0443\u0442\u043d\u043e \u0432\u0435\u0434\u0435\u0442 \u043e\u0433\u043e\u043d\u044c.<\/p>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections; using UnityEngine.SceneManagement; using System.Runtime.Serialization.Formatters.Binary; using System.IO;  public class carconroller : MonoBehaviour  { \tpublic GameObject laser;\/\/\u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043f\u0440\u0435\u0444\u0430\u0431\u043e\u043c  laser \tpublic GameObject laser3x;\/\/\u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043f\u0440\u0435\u0444\u0430\u0431\u043e\u043c laser3x \tpublic GameObject laserhor;\/\/\u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043f\u0440\u0435\u0444\u0430\u0431\u043e\u043c laserhor \tpublic GameObject laser3xhor;\/\/\u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043f\u0440\u0435\u0444\u0430\u0431\u043e\u043c laser3xhor \tpublic GameObject sphere;\/\/\u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043f\u0440\u0435\u0444\u0430\u0431\u043e\u043c sphere \tpublic GameObject sphere3x;\/\/\u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043f\u0440\u0435\u0444\u0430\u0431\u043e\u043c sphere3x \tpublic GameObject explosionplayer;\/\/\u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043f\u0440\u0435\u0444\u0430\u0431\u043e\u043c explosionplayer  \tfloat x,y,z,x1,y1; \tbool trigtime=false; \tpublic float speedreset=0.25f;\/\/\u043f\u0435\u0440\u0438\u043e\u0434 \u043f\u0435\u0440\u0435\u0437\u0430\u0440\u044f\u0434\u043a\u0438 \u043e\u0440\u0443\u0434\u0438\u044f \u0432 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445 \tfloat timer; \tVector2 startpos; \tVector2 startcar;         \/\/\u043e\u0431\u044a\u0435\u043a\u0442\u044b laser...sphere3x \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0440\u0443\u0436\u0438\u0435\u043c \u0430 \u043d\u0438\u0436\u0435 \u0431\u0443\u043b\u0435\u0432\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0430\u043a\u0442\u0438\u0432\u0430\u0442\u043e\u0440\u044b  \tpublic bool gun1 = true;\/\/\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043e 1 \u043e\u0440\u0443\u0436\u0438\u0435(laser), \u043e\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u0438 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u0431\u043e\u0435\u0437\u0430\u043f\u0430\u0441, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0438\u0434\u043e\u0432(laser3x...)  \tpublic bool gun2 = false;  \tpublic bool gun3 = false;  \tpublic bool gun4 = false;  \tpublic bool gun5 = false;  \tpublic bool gun6 = false;          \/\/\u041f\u0440\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u043e\u0440\u0443\u0436\u0438\u044f \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0442 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0431\u043e\u0435\u0437\u0430\u043f\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u041a\u043e\u0433\u0434\u0430 \u0431\u043e\u0435\u0437\u0430\u043f\u0430\u0441 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u0435 \u043e\u0440\u0443\u0436\u0438\u0435.  \tint guncount=0;\/\/\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u043e\u0435\u0437\u0430\u043f\u0430\u0441\u0430 \u0434\u043b\u044f \u043e\u0440\u0443\u0436\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0438\u0434\u0430 \u043e\u0440\u0443\u0436\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0431\u043e\u0435\u0437\u0430\u043f\u0430\u0441\u0430.   \tvoid Start ()  \t{ \t\ttimer = speedreset; \t\ty = laser.transform.position.y; \t\tz = laser.transform.position.z; \t}  \tpublic void Update ()  \t{ \t\tif (timer &lt; 0)  \t\t{ \t\t\ttimer = speedreset; \t\t\ttrigtime = false; \t\t} \t\t \t\tif (Input.GetMouseButton(0))\/\/\u041e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d  \t\t{  \t\t\tVector2 pos = Camera.main.ScreenToWorldPoint (Input.mousePosition);\/\/\u0417\u0430\u043f\u0438\u0441\u044c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e pos \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043a\u0430\u0441\u0430\u043d\u0438\u0435 \u044d\u043a\u0440\u0430\u043d\u0430. \t\t\ttransform.position = pos;\/\/\u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0438\u0433\u0440\u043e\u0432\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 pos \t\t\ttransform.position = new Vector2 (transform.position.x,transform.position.y+1f);\/\/\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438\u0433\u0440\u043e\u043a\u0430(\u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e)  \t\t\tif (timer==speedreset)\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438(\u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0440\u044f\u0434\u043a\u0438)  \t\t\t{ \t\t\t\tif (gun1 == true)\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043e\u0440\u0443\u0434\u0438\u044f  \t\t\t\t{ \t\t\t\t\tInstantiate (laser, new Vector2(transform.position.x,transform.position.y+1.1f), transform.rotation);\/\/\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u0432 \u0438\u0437 \u043f\u0440\u0435\u0444\u0430\u0431\u0430 laser \u0432 \u043c\u0435\u0441\u0442\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0438\u0433\u0440\u043e\u043a\u0430(\u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u0430\u043c\u0438) \t\t\t\t\ttrigtime = true; \t\t\t\t} \t\t\t\tif (gun2 == true && guncount &gt; 0)\/\/\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 2-\u0433\u043e \u043e\u0440\u0443\u0434\u0438\u044f \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443  \t\t\t\t{ \t\t\t\t\tguncount--;\/\/\u0421\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u0431\u043e\u0435\u043f\u0440\u0438\u043f\u0430\u0441\u043e\u0432 \t\t\t\t\tif (guncount == 0) \/\/\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0431\u043e\u0435\u043f\u0440\u0438\u043f\u0430\u0441\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0430\u0442\u0441\u044f \u0442\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c 1 \u043e\u0440\u0443\u0434\u0438\u0435 \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c \t\t\t\t\t{ \t\t\t\t\t\tgun1 = true; \t\t\t\t\t\tgun2 = false; \t\t\t\t\t\tgun3 = false; \t\t\t\t\t\tgun4 = false; \t\t\t\t\t\tgun5 = false; \t\t\t\t\t\tgun6 = false; \t\t\t\t\t} \t\t\t\t\tInstantiate (laser3x, new Vector2(transform.position.x,transform.position.y+1.1f), transform.rotation);\/\/\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u0432 \u0438\u0437 \u043f\u0440\u0435\u0444\u0430\u0431\u0430 laser3x \t\t\t\t\ttrigtime = true; \t\t\t\t}                                 \/\/\u041d\u0438\u0436\u0435 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0438\u0434\u043e\u0432 &quot;\u0432\u043e\u043e\u0440\u0443\u0436\u0435\u043d\u0438\u044f&quot; \u0432\u0441\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \t\t\t\tif (gun3 == true && guncount &gt; 0)  \t\t\t\t{ \t\t\t\t\tguncount--; \t\t\t\t\tif (guncount == 0)  \t\t\t\t\t{ \t\t\t\t\t\tgun1 = true; \t\t\t\t\t\tgun2 = false; \t\t\t\t\t\tgun3 = false; \t\t\t\t\t\tgun4 = false; \t\t\t\t\t\tgun5 = false; \t\t\t\t\t\tgun6 = false; \t\t\t\t\t} \t\t\t\t\tInstantiate (laserhor, new Vector2(transform.position.x,transform.position.y+1.1f), transform.rotation); \t\t\t\t\ttrigtime = true; \t\t\t\t} \t\t\t\tif (gun4 == true && guncount &gt; 0)  \t\t\t\t{ \t\t\t\t\tguncount--; \t\t\t\t\tif (guncount == 0)  \t\t\t\t\t{ \t\t\t\t\t\tgun1 = true; \t\t\t\t\t\tgun2 = false; \t\t\t\t\t\tgun3 = false; \t\t\t\t\t\tgun4 = false; \t\t\t\t\t\tgun5 = false; \t\t\t\t\t\tgun6 = false; \t\t\t\t\t} \t\t\t\t\tInstantiate (laser3xhor, new Vector2(transform.position.x,transform.position.y+2f), transform.rotation); \t\t\t\t\ttrigtime = true; \t\t\t\t} \t\t\t\tif (gun5 == true && guncount &gt; 0)  \t\t\t\t{ \t\t\t\t\tguncount--; \t\t\t\t\tif (guncount == 0)  \t\t\t\t\t{ \t\t\t\t\t\tgun1 = true; \t\t\t\t\t\tgun2 = false; \t\t\t\t\t\tgun3 = false; \t\t\t\t\t\tgun4 = false; \t\t\t\t\t\tgun5 = false; \t\t\t\t\t\tgun6 = false; \t\t\t\t\t} \t\t\t\t\tInstantiate (sphere, new Vector2(transform.position.x,transform.position.y+1.1f), transform.rotation); \t\t\t\t\ttrigtime = true; \t\t\t\t} \t\t\t\tif (gun6 == true && guncount &gt; 0)  \t\t\t\t{ \t\t\t\t\tguncount--; \t\t\t\t\tif (guncount == 0)  \t\t\t\t\t{ \t\t\t\t\t\tgun1 = true; \t\t\t\t\t\tgun2 = false; \t\t\t\t\t\tgun3 = false; \t\t\t\t\t\tgun4 = false; \t\t\t\t\t\tgun5 = false; \t\t\t\t\t\tgun6 = false; \t\t\t\t\t} \t\t\t\t\tInstantiate (sphere3x, new Vector2(transform.position.x,transform.position.y+2f), transform.rotation); \t\t\t\t\ttrigtime = true; \t\t\t\t} \t\t\t} \t\t\tif (trigtime == true)  \t\t\t{ \t\t\t\ttimer = timer - Time.deltaTime;\/\/\u041e\u0442\u0441\u0447\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0440\u044f\u0434\u043a\u0438 \t\t\t} \t\t} \t} \t\t \tvoid  OnTriggerEnter2D(Collider2D col) \t{ \t\tif (col.tag == &quot;systemcontrol&quot;)  \t\t{ \t\t\treturn;\/\/\u0412\u043e\u0437\u0432\u0440\u0430\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c controlcountobject \t\t} \t\tif (col.tag == &quot;gunactivator2&quot;)\/\/\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0435 \u0441 &quot;\u043a\u0430\u043f\u0441\u0443\u043b\u043e\u0439&quot; \u0434\u043b\u044f gunactivator2  \t\t{ \t\t\tgun2 = true;\/\/\u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u0440\u0443\u0434\u0438\u044f                         guncount = 85;\/\/\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0431\u043e\u0435\u043f\u0440\u0438\u043f\u0430\u0441\u043e\u0432 \t\t\tgun1 = false;\/\/\u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 &quot;\u043e\u0440\u0443\u0434\u0438\u0439&quot; \t\t\tgun3 = false; \t\t\tgun4 = false; \t\t\tgun5 = false; \t\t\tgun6 = false; \t\t\tDestroy (col.gameObject);\/\/\u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u0435 &quot;\u043a\u0430\u043f\u0441\u0443\u043b\u044b&quot; \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0435  \t\t\treturn; \t\t}                 \/\/\u041d\u0438\u0436\u0435 \u0432\u0441\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \t\tif (col.tag == &quot;gunactivator3&quot;)  \t\t{ \t\t\tgun3 = true; guncount = 50; \t\t\tgun1 = false; \t\t\tgun2 = false; \t\t\tgun4 = false; \t\t\tgun5 = false; \t\t\tgun6 = false; \t\t\tDestroy (col.gameObject); \t\t\treturn; \t\t} \t\tif (col.tag == &quot;gunactivator4&quot;)  \t\t{ \t\t\tgun4 = true; guncount = 15; \t\t\tgun1 = false; \t\t\tgun3 = false; \t\t\tgun2 = false; \t\t\tgun5 = false; \t\t\tgun6 = false; \t\t\tDestroy (col.gameObject); \t\t\treturn; \t\t} \t\tif (col.tag == &quot;gunactivator5&quot;)  \t\t{ \t\t\tgun5 = true; guncount = 100; \t\t\tgun1 = false; \t\t\tgun3 = false; \t\t\tgun4 = false; \t\t\tgun2 = false; \t\t\tgun6 = false; \t\t\tDestroy (col.gameObject); \t\t\treturn; \t\t} \t\tif (col.tag == &quot;gunactivator6&quot;)  \t\t{ \t\t\tgun6 = true; guncount = 50; \t\t\tgun1 = false; \t\t\tgun3 = false; \t\t\tgun4 = false; \t\t\tgun5 = false; \t\t\tgun2 = false; \t\t\tDestroy (col.gameObject); \t\t\treturn; \t\t}                 \/\/\u0415\u0441\u043b\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u0441 &quot;\u043a\u0430\u043f\u0441\u0443\u043b\u0430\u043c\u0438&quot; \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0442\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0447\u0442\u043e \u0438\u0433\u0440\u043e\u043a \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043b\u0430\u0437\u0435\u0440\u043e\u043c \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430, \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u043e\u043c \u0438\u043b\u0438 \u0441 \u0432\u0440\u0430\u0436\u0435\u0441\u043a\u0438\u043c \u0437\u0432\u0435\u0437\u0434\u043e\u043b\u0435\u0442\u043e\u043c. \u0417\u043d\u0430\u0447\u0438\u0442 \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0433\u0440\u043e\u043a\u0430 \u0441\u043e \u0441\u0446\u0435\u043d\u044b \t\tHandheld.Vibrate ();\/\/\u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u0432\u0438\u0431\u0440\u0430\u0446\u0438\u0438(\u0434\u043b\u044f \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u043e\u0432) \t\tif (GameObject.Find (&quot;Main Camera&quot;).GetComponent&lt;blockgenerator&gt; ().score&gt;GameObject.Find (&quot;Main Camera&quot;).GetComponent&lt;blockgenerator&gt; ().data)\/\/\u0415\u0441\u043b\u0438 \u0447\u0438\u0441\u043b\u043e \u0441\u0431\u0438\u0442\u044b\u0445 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u043e\u0432 \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432\u044b\u0448\u0435 \u0447\u0435\u043c \u0432 \u0444\u0430\u0439\u043b\u0435 \u0441 \u0438\u0433\u0440\u043e\u0432\u044b\u043c \u0440\u0435\u043a\u043e\u0440\u0434\u043e\u043c, \u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u043a\u043e\u0440\u0434\u0430 \u0432 \u0444\u0430\u0439\u043b \t\t{ \t\t\tStreamWriter scoredata=new StreamWriter(Application.persistentDataPath + &quot;\/score1.gd&quot;); \t\t\tscoredata.WriteLine(GameObject.Find (&quot;Main Camera&quot;).GetComponent&lt;blockgenerator&gt; ().score); \t\t\tscoredata.Close(); \t\t} \t\tInstantiate (explosionplayer, transform.position, transform.rotation);\/\/\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u0437\u0440\u044b\u0432\u0430 \u0437\u0432\u0435\u0437\u0434\u043e\u043b\u0435\u0442\u0430 \u0438\u0433\u0440\u043e\u043a\u0430 \t\tDestroy (col.gameObject);\/\/\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0435 \t\tDestroy(this.gameObject);\/\/\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u043a\u0430 \u0441 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0441\u0446\u0435\u043d\u044b \t} } <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/881\/c3d\/1d1\/881c3d1d11be4d21a7a6ff39fac1ff3c.png\"\/><\/p>\n<p>  \u0410\u043a\u0442\u0438\u0432\u0430\u0442\u043e\u0440\u044b \u043e\u0440\u0443\u0436\u0438\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/6e3\/7b6\/669\/6e37b66697de49f3ad28796706a2c628.gif\"\/><\/p>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0438\u0433\u0440\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d \u0430 \u0432 \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u043e\u0432\u044b\u0439 \u0440\u0435\u043a\u043e\u0440\u0434 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u043e\u0432, \u0442\u043e \u0442\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u043a\u0430\u043c\u0435\u0440\u0443:<\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections; using UnityEngine.SceneManagement; using System.Runtime.Serialization.Formatters.Binary; using System.IO;  public class Exit : MonoBehaviour {  \tpublic GameObject target;\/\/\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u044e\u0434\u0430 \u0437\u0432\u0435\u0437\u0434\u043e\u043b\u0435\u0442 \u0438\u0433\u0440\u043e\u043a\u0430 \tfloat timer=3f; \t \tvoid Start ()  \t{ \t\t \t}  \tvoid Update ()  \t{ \t\tif (Input.GetKey (KeyCode.Escape))\/\/\u0415\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0436\u0430\u0442\u0430 \u043a\u043d\u043e\u043f\u043a\u0430 \u043d\u0430\u0437\u0430\u0434 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0433\u0440\u044b, \u0442\u043e: \t\t{ \t\t\tif (GameObject.Find (&quot;Main Camera&quot;).GetComponent&lt;blockgenerator&gt; ().score&gt;GameObject.Find (&quot;Main Camera&quot;).GetComponent&lt;blockgenerator&gt; ().data) \t\t\t{ \t\t\t\tStreamWriter scoredata=new StreamWriter(Application.persistentDataPath + &quot;\/score1.gd&quot;); \t\t\t\tscoredata.WriteLine(GameObject.Find (&quot;Main Camera&quot;).GetComponent&lt;blockgenerator&gt; ().score);                                 \/\/\u0417\u0430\u043f\u0438\u0441\u044c \u0432 \u0444\u0430\u0439\u043b \u0440\u0435\u043a\u043e\u0440\u0434\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e score \u0438\u0437 &quot;blockgenerator&quot;, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0435  \t\t\t\tscoredata.Close(); \t\t\t} \t\t\tSceneManager.LoadScene (0);\/\/\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044e \t\t} \t\tif (!GameObject.Find (&quot;playercar&quot;))\/\/\u0415\u0441\u043b\u0438 \u0438\u0433\u0440\u043e\u043a \u0431\u044b\u043b \u0443\u0434\u0430\u043b\u0435\u043d \u0442\u043e \u043f\u043e \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u0438(\u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445) \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432 timer \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \t\t{ \t\t\ttimer = timer - Time.deltaTime; \t\t\tif (timer &lt; 0)  \t\t\t{ \t\t\t\tSceneManager.LoadScene (0); \t\t\t} \t\t}  \t} } <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u0442 \u0437\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0438\u0433\u0440\u043e\u043a\u0430.<\/p>\n<h4>\u0412\u0437\u0440\u044b\u0432\u044b<\/h4>\n<p>  \u042d\u0444\u0444\u0435\u043a\u0442 \u0432\u0437\u0440\u044b\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Particle System. \u041d\u043e \u0442\u043e\u0433\u0434\u0430 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0446\u0438\u043a\u043b\u0435\u043d\u043d\u044b\u043c \u0438 \u0432\u0435\u0447\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c\u0441\u044f. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0431\u044b\u043b\u043e, \u043d\u0430 \u043f\u0440\u0435\u0444\u0430\u0431 \u0432\u0437\u0440\u044b\u0432\u0430 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;  public class DestroyAsteroid : MonoBehaviour {  \tvoid Start ()  \t{ \t\t \t}  \tvoid Update ()  \t{ \t\tDestroy (this.gameObject,0.4f);\/\/\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f. \u0412\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 400 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c. \t} } <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/3ed\/59d\/ada\/3ed59dadadb64cecb63bd6722e02dd34.gif\"\/><\/p>\n<h4>\u0412\u044b\u0441\u0442\u0440\u0435\u043b\u044b<\/h4>\n<p>  \u0412\u044b\u0441\u0442\u0440\u0435\u043b\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438\u0437 \u043c\u0435\u0441\u0442\u0430 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0435\u0433\u043e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4e8\/4fd\/1d6\/4e84fd1d6d42431da5046bfc522cba9e.png\"\/><\/p>\n<p>  \u0412 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0434\u043b\u044f \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections; using System.Runtime.Serialization.Formatters.Binary; using System.IO;  public class laser : MonoBehaviour {   \tfloat speedlaser=0.5f;  \tvoid Start ()  \t{  \t}  \tvoid Update ()  \t{ \t\ttransform.Translate (new Vector3 (0, speedlaser, 0f));\t \t} } <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u043e\u0432<\/h4>\n<p>  \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u043e\u0432 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u043e\u0432.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/18b\/939\/6f2\/18b9396f2c7d4bfb87a620eb43ae4910.png\"\/><\/p>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 Enemygenerator:<\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;  public class enemygenerator : MonoBehaviour {  \tpublic GameObject enemy; \tbool trigtime=false; \tfloat speedreset=2f; \tfloat timer,x;  \tvoid Start ()  \t{ \t\ttimer = speedreset; \t}  \tvoid Update ()  \t{ \t\tif (timer &lt; 0)  \t\t{ \t\t\ttimer = speedreset; \t\t\ttrigtime = false; \t\t} \t\tif (timer == speedreset)  \t\t{ \t\t\tx = Random.Range (-2.5f, 2.5f);\/\/\u0417\u0430\u0434\u0430\u0435\u043c \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \t\t\tInstantiate(enemy, new Vector2(x,5.5f),transform.rotation);\/\/\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430 \u0438\u0437 \u043f\u0440\u0435\u0444\u0430\u0431\u0430 \t\t\ttrigtime = true; \t\t} \t\tif (trigtime == true)  \t\t{ \t\t\ttimer = timer - Time.deltaTime; \t\t} \t} } <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/111\/f76\/6f1\/111f766f19fe4defabc5ef0c78f9cab2.gif\"\/><\/p>\n<h4>\u041b\u043e\u0433\u0438\u043a\u0430 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430<\/h4>\n<p>  \u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u0435\u0442\u0438\u0442 \u043f\u043e \u043f\u0440\u044f\u043c\u043e\u0439, \u0432\u0435\u0434\u0435\u0442 \u043e\u0433\u043e\u043d\u044c \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043f\u0441\u0443\u043b\u0443 \u0434\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0438\u0433\u0440\u043e\u043a\u043e\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u0440\u0443\u0436\u0438\u044f<\/p>\n<p>  \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/46a\/61e\/65c\/46a61e65c3d044a8bd79ac3e13b3c34a.gif\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c11\/b53\/a23\/c11b53a239a14550a53ffc8596c4eaff.png\"\/><\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;  public class enemylogic : MonoBehaviour {  \tpublic GameObject explosionenemy;\/\/\u041f\u0440\u0435\u0444\u0430\u0431 \u0432\u044b\u0437\u0440\u044b\u0432\u0430 \tpublic GameObject laserenemy;\/\/\u041f\u0440\u0435\u0444\u0430\u0431 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430         \/\/\u041f\u0440\u0435\u0444\u0430\u0431\u044b \u043a\u0430\u043f\u0441\u0443\u043b \u0434\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0438\u0434\u043e\u0432 \u043e\u0440\u0443\u0436\u0438\u044f \tpublic GameObject gunactivator2; \tpublic GameObject gunactivator3; \tpublic GameObject gunactivator4; \tpublic GameObject gunactivator5; \tpublic GameObject gunactivator6;         \/\/ \tbool trigtime=false; \tfloat speedreset=1.5f;\/\/\u0412\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0440\u044f\u0434\u043a\u0438 \tfloat timer; \tfloat speedenemy = -0.02f;\/\/\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435  \tfloat x;  \tvoid Start ()  \t{ \t\ttimer = speedreset; \t} \t  \tvoid Update ()  \t{ \t\tif (timer &lt; 0)  \t\t{ \t\t\ttimer = speedreset; \t\t\ttrigtime = false; \t\t} \t\tif (timer == speedreset)  \t\t{ \t\t\tInstantiate (laserenemy, new Vector2(transform.position.x,transform.position.y-0.4f), transform.rotation); \t\t\ttrigtime = true; \t\t} \t\tif (trigtime == true)  \t\t{ \t\t\ttimer = timer - Time.deltaTime; \t\t} \t\ttransform.Translate (new Vector3 (0, speedenemy, 0f)); \t}  \tvoid  OnTriggerEnter2D(Collider2D col) \t{ \t\tif (col.tag == &quot;systemcontrol&quot;)  \t\t{ \t\t\treturn; \t\t} \t\tif (col.tag == &quot;Player&quot;)  \t\t{ \t\t\tInstantiate (explosionenemy, transform.position, transform.rotation); \t\t\tDestroy(this.gameObject); \t\t} \t\tif (col.tag == &quot;laser&quot;)  \t\t{ \t\t\tx = Random.Range (0f, 100f);\/\/\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043b\u044e\u0431\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0442 0 \u0434\u043e 100 \t\t\tif (x &gt; 1f && x &lt; 5f) \/\/\u0435\u0441\u043b\u0438 \u0447\u0438\u0441\u043b\u043e \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u043e\u0442 1 \u0434\u043e 5 \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043f\u0441\u0443\u043b\u0430 gunactivator2 \t\t\t{ \t\t\t\tInstantiate (gunactivator2, transform.position, transform.rotation); \t\t\t}                         \/\/\u0412\u043d\u0438\u0437\u0443 \u0432\u0441\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \t\t\tif (x &gt; 20f && x &lt; 25f)  \t\t\t{ \t\t\t\tInstantiate (gunactivator3, transform.position, transform.rotation); \t\t\t} \t\t\tif (x &gt; 40f && x &lt; 45f)  \t\t\t{ \t\t\t\tInstantiate (gunactivator4, transform.position, transform.rotation); \t\t\t} \t\t\tif (x &gt; 60f && x &lt; 65f)  \t\t\t{ \t\t\t\tInstantiate (gunactivator5, transform.position, transform.rotation); \t\t\t} \t\t\tif (x &gt; 80f && x &lt; 85f)  \t\t\t{ \t\t\t\tInstantiate (gunactivator6, transform.position, transform.rotation); \t\t\t} \t\t\tInstantiate (explosionenemy, transform.position, transform.rotation); \t\t\tDestroy(this.gameObject); \t\t} \t} } <\/code><\/pre>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u0435\u0444\u0430\u0431 \u00ab\u043a\u0430\u043f\u0441\u0443\u043b\u044b\u00bb \u0441 \u043e\u0440\u0443\u0436\u0438\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0432\u0438\u0436\u0435\u0442\u0441\u044f \u043f\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043a \u0438\u0433\u0440\u043e\u043a\u0443 \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u044f \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/018\/9c3\/143\/0189c314339847b3946a31c668f3bbcd.png\"\/><\/p>\n<pre><code class=\"cs\">using UnityEngine; using System.Collections;  public class gunactivatorlogic : MonoBehaviour {  \tfloat speed = -0.025f;  \tvoid Start ()  \t{ \t \t}  \tvoid Update ()  \t{ \t\ttransform.Translate (new Vector3 (0, speed, 0f)); \t} } <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0418\u0442\u043e\u0433<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/826\/b87\/107\/826b8710798b40cd98109a5568550e85.gif\"\/><\/p>\n<h4>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f<\/h4>\n<p>  \u0412\u044b\u0445\u043e\u0434 \u0438\u0433\u0440\u044b \u043d\u0430 google play \u043d\u0435 \u0443\u0432\u0435\u043d\u0447\u0430\u043b\u0441\u044f \u043e\u0441\u043e\u0431\u044b\u043c \u0443\u0441\u043f\u0435\u0445\u043e\u043c. \u0417\u0430 \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0435\u0431\u044b\u0432\u0430\u043d\u0438\u044f \u0432 \u043c\u0430\u0440\u043a\u0435\u0442\u0435 \u043d\u0430\u0431\u0440\u0430\u043b\u043e\u0441\u044c \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 500 \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u043a.<br \/>  <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.WRXM4STER.SpaceStriker\">play.google.com\/store\/apps\/details?id=com.WRXM4STER.SpaceStriker<\/a><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/1e9\/f32\/f7a\/1e9f32f7adbe4e648de17bd3eb56de43.png\"\/><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\/324288\/\"> https:\/\/habrahabr.ru\/post\/324288\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/dea\/578\/b7d\/dea578b7d7d642ad9ea271c04363b1ba.png\" \/><\/div>\n<p>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a! \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0432\u043e\u0435\u0439 \u0438\u0433\u0440\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 Unity.<\/p>\n<p>  \u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u0438\u0433\u0440\u044b \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043d\u0430 \u0441\u0435\u0431\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0432\u0435\u0437\u0434\u043e\u043b\u0435\u0442\u043e\u043c \u0438 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u0435\u043e\u0440\u0438\u0442\u043e\u0432. \u041d\u0430 \u0432\u0430\u0448\u0435\u043c \u043f\u0443\u0442\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432\u0440\u0430\u0436\u0435\u0441\u043a\u0438\u0435 \u0437\u0432\u0435\u0437\u0434\u043e\u043b\u0435\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043c\u0435\u0448\u0430\u0442\u044c \u0432\u0430\u043c \u0438 \u043f\u043e\u0441\u043b\u0435 \u0438\u0445 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u00ab\u043a\u0430\u043f\u0441\u0443\u043b\u044b\u00bb \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f \u043e\u0440\u0443\u0436\u0438\u044f. \u0418\u0433\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f Galaxy Desteroid.  <\/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-283498","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283498","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=283498"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283498\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}