<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
    <channel>
        <title>samanablog - Блог</title>
        <link>http://samanablog.mozello.com/blog/</link>
        <description>samanablog - Блог</description>
                    <item>
                <title>КАК СДЕЛАТЬ ОБЛЁТ КАМЕРОЙ ВОКРУГ ОБЪЕКТА</title>
                <link>http://samanablog.mozello.com/blog/params/post/1106455/kak-sdelat-obljot-kameroj-vokrug-obekta</link>
                <pubDate>Thu, 23 Feb 2017 22:27:00 +0000</pubDate>
                <description>&amp;nbsp;&lt;span style=&quot;color: rgb(102, 102, 102); font-size: 14px;&quot;&gt;Например у вас ситуация, когда надо иметь возможность крутить камеру мышкой вокруг какого-то объекта. Это может быть персонаж или рассматривание объекта в инвентаре или просто надо сосредоточится на какой-то точке. Это очень просто сделать!&lt;br&gt;&lt;/span&gt;&lt;hr class=&quot;moze-more-divider&quot;&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;Создайте на сцене простой объект-цель куб и приблизьте к нему дефолтную камеру поближе, если она вдруг очень далеко.&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;Создаём единственный скрипт, который будет контролировать нашу идею и соответственно он должен иметь ссылки на камеру &amp;nbsp;и на объект в &amp;nbsp;сцене. Плюс добавим свойство для скорости движения камеры, ведь она может вращаться как быстро, так и медленно.&lt;/p&gt;&lt;ol class=&quot;lines no-wrap&quot; style=&quot;font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; background: none; margin-left: 3.5em; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12.8px; outline: 0px; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;using&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;UnityEngine;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;CameraOrbit : MonoBehaviour&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Camera cam;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Transform targetObject;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;float&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;orbitSpeed = 10f;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;&quot;&gt;Вы можете повесить этот скрипт на любой объект в сцене.&lt;/p&gt;&lt;p style=&quot;&quot;&gt;Перетащите в поле&amp;nbsp;&lt;b&gt;cam&amp;nbsp;&lt;/b&gt;вашу камеру, а в поле&amp;nbsp;&lt;b&gt;targetObject&amp;nbsp;&lt;/b&gt;объект-цель со сцены. Скорость пока можете не менять, вдруг она подойдёт.&lt;/p&gt;&lt;p style=&quot;&quot;&gt;Все движения камеры будем обрабатывать в&amp;nbsp;&lt;b&gt;Update&amp;nbsp;&lt;/b&gt;и так как ваш объект может двигаться, сделаем так, чтобы камера автоматически изначально нацеливалась на него.&amp;nbsp;&lt;/p&gt;&lt;ol class=&quot;lines no-wrap&quot; style=&quot;font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; background: none; margin-left: 3.5em; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12.8px; outline: 0px; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;using&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;UnityEngine;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;CameraOrbit : MonoBehaviour&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Camera cam;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Transform targetObject;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;float&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;orbitSpeed = 10f;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;void&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Update()&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;cam.transform.LookAt(targetObject, Vector3.up);&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;&quot;&gt;Сначала сделаем так, чтобы при зажатии ЛКМ и движении, камера крутилась вокруг объекта по оси Y (как будто водим хоровод вокруг ёлочки в детском садике). Для этого ловим само зажатие и узнаём - насколько сдвинулась мышь по X на экране и крутим камеру с нашей скоростью.&lt;/p&gt;&lt;ol class=&quot;lines no-wrap&quot; style=&quot;font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; background: none; margin-left: 3.5em; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12.8px; outline: 0px; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;void&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Update()&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;cam.transform.LookAt(targetObject, Vector3.up);&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;(Input.GetMouseButton(0))&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;float&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;deltaX = Input.GetAxis(&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: blue; white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&quot;Mouse X&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;);&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;cam.transform.RotateAround(targetObject.transform.position, Vector3.up, deltaX * orbitSpeed);&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;&quot;&gt;Метод RotateAround в данном случае принимает следующие параметры:&lt;/p&gt;&lt;p style=&quot;&quot;&gt;&lt;/p&gt;&lt;ol style=&quot;font-family: &amp;quot;Open Sans&amp;quot;, Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal;&quot;&gt;&lt;li&gt;центр, вокруг которого будет кручение&lt;/li&gt;&lt;li&gt;ось по которой будет кручение&amp;nbsp;&lt;/li&gt;&lt;li&gt;угол на который прокрутить объект&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;Это должно выглядеть как-то так&lt;/p&gt;&lt;p style=&quot;&quot;&gt;&lt;img src=&quot;http://site-472753.mozfiles.com/files/472753/rotateY.gif?1487882213&quot; class=&quot;&quot; style=&quot;display: block; box-sizing: border-box; cursor: default !important;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;Теперь так же добавим кручение камерой вверх и вниз, чтобы можно было посмотреть на лысину объекта или подсмотреть снизу на &amp;nbsp;Лару Крофт. Для этого уже будем ловить сдвиг мыши по Y и вертеть камеру относительно её собственной оси X.&lt;/p&gt;&lt;ol class=&quot;lines no-wrap&quot; style=&quot;font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; background: none; margin-left: 3.5em; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12.8px; outline: 0px; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;void&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Update()&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;cam.transform.LookAt(targetObject, Vector3.up);&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;(Input.GetMouseButton(0))&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;float&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;deltaX = Input.GetAxis(&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: blue; white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&quot;Mouse X&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;);&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;float&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;moze-important&quot;&gt; &lt;/span&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;deltaY = Input.GetAxis(&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: blue; white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;&quot;Mouse Y&quot;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;cam.transform.RotateAround(targetObject.transform.position, Vector3.up, deltaX * orbitSpeed);&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;cam.transform.RotateAround(targetObject.transform.position, cam.transform.right, deltaY * -orbitSpeed);&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;&quot;&gt;Сейчас уже можно облететь объект со всех сторон&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;http://site-472753.mozfiles.com/files/472753/rotateYX.gif?1487882217&quot; class=&quot;&quot; style=&quot;display: block; box-sizing: border-box; cursor: default !important;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Но конечно же хочется иметь возможность приближаться и отдалятся. Для этого уже будем использовать ПКМ. Добавьте ещё пару строчек и весь код выглядит таким образом:&lt;/p&gt;&lt;ol class=&quot;lines no-wrap&quot; style=&quot;font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; background: none; margin-left: 3.5em; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12.8px; outline: 0px; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;using&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;UnityEngine;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;CameraOrbit : MonoBehaviour&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Camera cam;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Transform targetObject;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;float&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;orbitSpeed = 10f;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;void&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Update()&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;cam.transform.LookAt(targetObject, Vector3.up);&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;(Input.GetMouseButton(0))&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;float&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;deltaX = Input.GetAxis(&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: blue; white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&quot;Mouse X&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;);&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;float&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;deltaY = Input.GetAxis(&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: blue; white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&quot;Mouse Y&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;);&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;cam.transform.RotateAround(targetObject.transform.position, Vector3.up, deltaX * orbitSpeed);&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;cam.transform.RotateAround(targetObject.transform.position, cam.transform.right, deltaY * -orbitSpeed);&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;if&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;moze-important&quot;&gt; &lt;/span&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;(Input.GetMouseButton(1))&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;{&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;float&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;moze-important&quot;&gt; &lt;/span&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;deltaY = Input.GetAxis(&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: blue; white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;&quot;Mouse Y&quot;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;cam.transform.position += cam.transform.forward * deltaY;&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;span class=&quot;moze-important&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;&quot;&gt;Результат наших трудов&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;http://site-472753.mozfiles.com/files/472753/rotateAll.gif?1487882212&quot; style=&quot;display: block; box-sizing: border-box; cursor: default !important;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;p.s.&amp;nbsp;&lt;span style=&quot;white-space: nowrap;&quot;&gt;&quot;Mouse X&quot; и&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;white-space: nowrap;&quot;&gt;&quot;Mouse Y&quot; это имена осей, который вы можете посмотреть или изменить в меню Edit - Project Settings - Input.&lt;/span&gt;&lt;/p&gt;</description>
            </item>
                    <item>
                <title>ДОСТУП К СКРИПТУ ДРУГОГО ОБЪЕКТА</title>
                <link>http://samanablog.mozello.com/blog/params/post/1106448/kakaja-to-novaja-zapis</link>
                <pubDate>Thu, 23 Feb 2017 22:16:00 +0000</pubDate>
                <description>&lt;p style=&quot;&quot;&gt;Очень часто начинающие в Unity задаются подобным вопросом, поэтому давайте разберём эту тему раз и навсегда.&lt;/p&gt;&lt;hr class=&quot;moze-more-divider&quot;&gt;&lt;p style=&quot;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;Когда вы выделяете GameObject, то всё, что находится у него в инспекторе - это компоненты в том числе и ваши собственные скрипты.&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;http://site-472753.mozfiles.com/files/472753/components.JPG&quot; style=&quot;font-size: 14px; display: block; box-sizing: border-box; cursor: default !important;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;Обратиться к компоненту можно с помощью метода &amp;nbsp;&lt;b style=&quot;&quot;&gt;GetComponent&amp;lt;Тип&amp;gt;().&amp;nbsp;&lt;/b&gt;Тип - имя компонента либо вашего класса.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;Например у вас на сцене есть объекты&amp;nbsp;&lt;b style=&quot;&quot;&gt;orc&amp;nbsp;&lt;/b&gt;и&amp;nbsp;&lt;b style=&quot;&quot;&gt;door&lt;/b&gt;. Вы хотите чтобы&amp;nbsp;&lt;b style=&quot;&quot;&gt;orc&amp;nbsp;&lt;/b&gt;обратился к двери и открыл её. У двери есть свойство &quot;открыто/закрыто&quot;&lt;/p&gt;&lt;ol class=&quot;lines no-wrap&quot; style=&quot;margin-left: 3.5em; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12.8px; background: none; outline: 0px; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;using&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;UnityEngine;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Door : MonoBehaviour&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;bool&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;isOpen =&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;false&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;&quot;&gt;Чтобы орк обратился к скрипту двери, то можно поступить разными способами.&lt;/p&gt;&lt;p style=&quot;&quot;&gt;&lt;b style=&quot;&quot;&gt;Способ 1&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;Передать орку ссылку на дверь вручную. Для этого создаём у орка свойство, которое будет содержать ссылку на скрипт конкретной двери.&lt;/p&gt;&lt;ol class=&quot;lines no-wrap&quot; style=&quot;margin-left: 3.5em; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12.8px; background: none; outline: 0px; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;using&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;UnityEngine;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Orc : MonoBehaviour&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Door someDoor;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;&quot;&gt;Теперь в инспекторе орка увидим появившееся поле&amp;nbsp;&lt;b style=&quot;&quot;&gt;someDoor&lt;/b&gt;&amp;nbsp;в которое перенесём объект(GameObject)&amp;nbsp;&lt;b style=&quot;&quot;&gt;door&amp;nbsp;&lt;/b&gt;(на котором есть скрипт&amp;nbsp;&lt;b style=&quot;&quot;&gt;Door&lt;/b&gt;)&amp;nbsp;со сцены.&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;http://site-472753.mozfiles.com/files/472753/dragScript.gif?1487867158&quot; alt=&quot;dragScriptAnim&quot; style=&quot;font-size: 14px; display: block; box-sizing: border-box; cursor: default !important;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;И орк может напрямую обратиться к двери и открыть её например.&lt;/p&gt;&lt;ol class=&quot;lines no-wrap&quot; style=&quot;margin-left: 3.5em; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12.8px; background: none; outline: 0px; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;using&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;UnityEngine;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Orc : MonoBehaviour&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Door someDoor;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;private&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;void&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Start()&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;comments&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 130, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;// орк выбивает дверь ногой&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;someDoor.isOpen =&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;true&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;&lt;b style=&quot;&quot;&gt;Способ 2&lt;/b&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;Орк может самостоятельно найти дверь в мире, перебрав все объекты в сцене и найти дверь по её имени&lt;/p&gt;&lt;ol class=&quot;lines no-wrap&quot; style=&quot;margin-left: 3.5em; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12.8px; background: none; outline: 0px; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;using&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;UnityEngine;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Orc : MonoBehaviour&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;comments&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 130, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;// приватное свойство его уже не видно в инспекторе&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;private&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Door someDoor;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;private&lt;/code&gt; &lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;void&lt;/code&gt; &lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;Start()&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;{&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;someDoor = GameObject.Find(&lt;/code&gt;&lt;code class=&quot;string&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: blue; white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&quot;door&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;).GetComponent&amp;lt;Door&amp;gt;();&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;someDoor.isOpen =&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;keyword&quot; style=&quot;font-weight: bold; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 102, 153); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;true&lt;/code&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;;&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt2&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background: rgb(248, 248, 248); color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; float: none; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;}&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;&quot;&gt;Но метод&amp;nbsp;&lt;b style=&quot;&quot;&gt;Find&amp;nbsp;&lt;/b&gt;и подобные ему не рекомендуют часто использовать, например в&amp;nbsp;&lt;b style=&quot;&quot;&gt;Update&lt;/b&gt;, так как подобные поиски могут нагрузить вашу игру. Поэтому лучше такие операции выполнять либо редко, либо вначале игры. Это касается и вызов&amp;nbsp;&lt;span style=&quot;white-space: nowrap;&quot;&gt;&lt;b style=&quot;&quot;&gt;GetComponent,&amp;nbsp;&lt;/b&gt;поэтому кешируйте свойства, как показано выше.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;&lt;b style=&quot;&quot;&gt;Способ 3&lt;/b&gt;&lt;span style=&quot;white-space: nowrap;&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;&quot;&gt;Орк может поискать дверь не только по имени, но и по скрипту.&lt;/p&gt;&lt;ol class=&quot;lines no-wrap&quot; style=&quot;margin-left: 3.5em; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12.8px; background: none; outline: 0px; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;&lt;li class=&quot;alt1&quot; style=&quot;border-left: 3px solid rgb(204, 204, 204); font-size: 1em; padding-left: 0.5em; outline: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; color: rgb(102, 102, 102); white-space: pre;&quot;&gt;&lt;code class=&quot;plain&quot; style=&quot;line-height: 1.1em; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 1em; outline: 0px; background: none; color: rgb(0, 0, 0); white-space: nowrap; position: static; left: auto; top: auto; right: auto; bottom: auto; height: auto; width: auto; min-height: auto;&quot;&gt;someDoor = FindObjectOfType&amp;lt;Door&amp;gt;();&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;&quot;&gt;Но в этом случает в&amp;nbsp;&lt;b style=&quot;&quot;&gt;someDoor&amp;nbsp;&lt;/b&gt;запишется первая попавшаяся дверь на сцене.&lt;/p&gt;&lt;p style=&quot;&quot;&gt;&lt;span style=&quot;white-space: nowrap;&quot;&gt;Конечно это не все способы поиска нужного объекта. Но для начала этого вам будет достаточно.&lt;/span&gt;&lt;/p&gt;</description>
            </item>
            </channel>
</rss>