<?xml version="1.0" encoding="windows-1251"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://crazybyte.7bb.ru/export.php?type=rss" rel="self" type="application/rss+xml" />
		<title>Crazy Byte Keeper</title>
		<link>https://crazybyte.7bb.ru/</link>
		<description>Crazy Byte Keeper</description>
		<language>ru-ru</language>
		<lastBuildDate>Sat, 04 Feb 2017 19:13:37 +0300</lastBuildDate>
		<generator>MyBB/mybb.ru</generator>
		<item>
			<title>Уроки</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=25#p25</link>
			<description>&lt;p&gt;&lt;a href=&quot;http://catlikecoding.com/unity/tutorials/frames-per-second/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://catlikecoding.com/unity/tutorial &amp;#8230; er-second/&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Sat, 04 Feb 2017 19:13:37 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=25#p25</guid>
		</item>
		<item>
			<title>деформация меша</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=24#p24</link>
			<description>&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=c-pqEHR1jnw&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://www.youtube.com/watch?v=c-pqEHR1jnw&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Sat, 04 Feb 2017 18:33:42 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=24#p24</guid>
		</item>
		<item>
			<title>приватные сообщения</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=23#p23</link>
			<description>&lt;p&gt;&lt;a href=&quot;https://toster.ru/q/79184&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Ссылка&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Fri, 06 Jan 2017 08:39:21 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=23#p23</guid>
		</item>
		<item>
			<title>Разработка многопользовательских игр с помощью Node.js и Socket.IO</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=22#p22</link>
			<description>&lt;p&gt;&lt;a href=&quot;http://frontender.info/building-multiplayer-games-with-node-js-and-socket-io/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Fri, 06 Jan 2017 08:37:05 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=22#p22</guid>
		</item>
		<item>
			<title>Karlov</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=21#p21</link>
			<description>&lt;p&gt;&lt;a href=&quot;http://www.ant-karlov.ru/PlayerIO-vvedenie.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Karlov&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Fri, 06 Jan 2017 07:35:54 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=21#p21</guid>
		</item>
		<item>
			<title>mmorpg\github</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=20#p20</link>
			<description>&lt;p&gt;&lt;a href=&quot;https://github.com/Adrinalin4ik/MMO-RPG/commits/master&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;mmorpgSocketIO&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Fri, 06 Jan 2017 07:12:24 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=20#p20</guid>
		</item>
		<item>
			<title>Node new video</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=19#p19</link>
			<description>&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=Vqdlrky4cTM&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;New video for node.js&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Fri, 06 Jan 2017 06:14:14 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=19#p19</guid>
		</item>
		<item>
			<title>sea battle</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=18#p18</link>
			<description>&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=CmXvGaHln20&amp;amp;feature=youtu.be&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;sea battle&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Thu, 05 Jan 2017 16:08:38 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=18#p18</guid>
		</item>
		<item>
			<title>Node.js</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=17#p17</link>
			<description>&lt;p&gt;&lt;a href=&quot;https://www.pluralsight.com/courses/unity-multiplayer-game-dev-node-2454&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Node js&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Thu, 05 Jan 2017 16:06:44 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=17#p17</guid>
		</item>
		<item>
			<title>Метеостанция на Arduino от А до Я</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=16#p16</link>
			<description>&lt;p&gt;&lt;a href=&quot;http://qps.ru/tzE8a&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Wi-fi метеостанция&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Tue, 20 Dec 2016 13:15:16 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=16#p16</guid>
		</item>
		<item>
			<title>How to integrate Arduino with Unity</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=15#p15</link>
			<description>&lt;p&gt;&lt;a href=&quot;http://qps.ru/KVZB3&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Arduino with Unity&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Mon, 19 Dec 2016 14:49:10 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=15#p15</guid>
		</item>
		<item>
			<title>Unity3d + Arduino (Read serial in Unity3d)</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=14#p14</link>
			<description>&lt;p&gt;&lt;a href=&quot;http://qps.ru/1U2EY&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Unity+Arduino&lt;/a&gt;&lt;/p&gt;
						&lt;p&gt;Arduino:&lt;/p&gt;&lt;div class=&quot;code-box&quot;&gt;&lt;strong class=&quot;legend&quot;&gt;Код:&lt;/strong&gt;&lt;div class=&quot;blockcode&quot;&gt;&lt;div class=&quot;scrollbox&quot; style=&quot;height: 35em&quot;&gt;&lt;pre&gt;float value = 0;
boolean flip = false;

void setup()
{

 Serial.begin(9600);
}

void loop()
{
 if(value &amp;gt;= 1023)
 {
     flip = true;
 }else if(value &amp;lt;= 0)
 {
     flip = false;
 }

 if(flip == false)
 {
    value += 1;
 }else{
    value -= 1;
 }

 float values[] = {0,0,value};

 Serial.flush(); //clears any possible left over information
 Serial.print(map(values[0],0,1023,0,360)); //Resizes values from the range on arduino input to 360 of rotation.
 Serial.print(&amp;quot;,&amp;quot;);
 Serial.print(map(values[1],0,1023,0,360));
 Serial.print(&amp;quot;,&amp;quot;);
 Serial.print(map(values[2],0,1023,0,360));
 Serial.println();

 delay(10);
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;c#:&lt;/p&gt;&lt;div class=&quot;code-box&quot;&gt;&lt;strong class=&quot;legend&quot;&gt;Код:&lt;/strong&gt;&lt;div class=&quot;blockcode&quot;&gt;&lt;div class=&quot;scrollbox&quot; style=&quot;height: 35em&quot;&gt;&lt;pre&gt;using UnityEngine;
using System.Collections;
using System.IO.Ports;

public class serialRotation : MonoBehaviour {

     SerialPort stream = new SerialPort(&amp;quot;COM4&amp;quot;, 9600); //Set the port (com4) and the baud rate (9600, is standard on most devices)
     float[] lastRot = {0,0,0}; //Need the last rotation to tell how far to spin the camera
     
     
     void Start () {
           stream.Open(); //Open the Serial Stream.
     }
     
     // Update is called once per frame
     void Update () {
           string value = stream.ReadLine(); //Read the information
           string[] vec3 = value.Split(&#039;,&#039;); //My arduino script returns a 3 part value (IE: 12,30,18)
           if(vec3[0] != &amp;quot;&amp;quot; &amp;amp;&amp;amp; vec3[1] != &amp;quot;&amp;quot; &amp;amp;&amp;amp; vec3[2] != &amp;quot;&amp;quot;) //Check if all values are recieved
           {
                 transform.Rotate(                  //Rotate the camera based on the new values
                                               float.Parse(vec3[0])-lastRot[0],
                                               float.Parse(vec3[1])-lastRot[1],
                                               float.Parse(vec3[2])-lastRot[2],
                                               Space.Self
                                         );
                 lastRot[0] = float.Parse(vec3[0]);  //Set new values to last time values for the next loop
                 lastRot[1] = float.Parse(vec3[1]);
                 lastRot[2] = float.Parse(vec3[2]);
                 stream.BaseStream.Flush(); //Clear the serial information so we assure we get new information.
           }
     }
     
     void OnGUI()
     {
           string newString = &amp;quot;Connected: &amp;quot; + transform.rotation.x + &amp;quot;, &amp;quot; + transform.rotation.y + &amp;quot;, &amp;quot; + transform.rotation.z;
           GUI.Label(new Rect(10,10,300,100), newString); //Display new values
           // Though, it seems that it outputs the value in percentage O-o I don&#039;t know why.
     }
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Mon, 19 Dec 2016 10:13:00 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=14#p14</guid>
		</item>
		<item>
			<title>Почитать на досуге</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=13#p13</link>
			<description>&lt;p&gt;&lt;a href=&quot;http://qps.ru/rKLW7&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Темка с GcUp&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Sun, 18 Dec 2016 08:40:25 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=13#p13</guid>
		</item>
		<item>
			<title>Amazon Lumberyard Tutorials</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=12#p12</link>
			<description>&lt;p&gt;&lt;a href=&quot;http://qps.ru/lmZVe&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;MisterToolbox&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Sun, 18 Dec 2016 08:36:33 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=12#p12</guid>
		</item>
		<item>
			<title>unity-multiplayer-game-dev-node</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=11#p11</link>
			<description>&lt;p&gt;&lt;a href=&quot;http://qps.ru/UHZQc&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;unity-multiplayer-game-dev-node&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Sun, 18 Dec 2016 08:34:00 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=11#p11</guid>
		</item>
		<item>
			<title>Управление для андроидовского зоопарка(под напильник)</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=10#p10</link>
			<description>&lt;div class=&quot;code-box&quot;&gt;&lt;strong class=&quot;legend&quot;&gt;Код:&lt;/strong&gt;&lt;div class=&quot;blockcode&quot;&gt;&lt;div class=&quot;scrollbox&quot; style=&quot;height: 35em&quot;&gt;&lt;pre&gt;public class TakeInput : MonoBehaviour {

    // Флаг, отвечающий за перетаскивание
    bool isDragging = false;

    void Update ()
    {
  // Проверяем, есть ли нажатия. Если нажатий нет, то выходим из функции.
  if (Input.touchCount &amp;lt; 1)
   return;
  
  // Получаем первое нажатие
  Touch _touch = Input.GetTouch (0);
  // Преобразуем координаты нажатия, делаем рейкаст и получаем коллайдер (если он есть)
  Vector2 touchPos = Camera.main.ScreenToWorldPoint (_touch.position);
  RaycastHit2D ray = Physics2D.Raycast (touchPos, Vector2.zero);
  Collider2D c2d = ray.collider;

  // Проверяем есть ли коллизия с Draggable объектом
  if (c2d != null &amp;amp;&amp;amp; c2d.gameObject.tag == &amp;quot;Draggable&amp;quot;) {
   // При начале касания - устанавливаем флаг isDragging
   if (_touch.phase == TouchPhase.Began)
    isDragging = true;
   // При завершении или прерывании касания - убираем флаг
   else if (_touch.phase == TouchPhase.Ended || _touch.phase == TouchPhase.Canceled)
    isDragging = false;
   // Если стоит флаг isDragging, то перемещаем объект
   if (isDragging)
    c2d.transform.position = touchPos;
  }
    }
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Sun, 18 Dec 2016 08:22:16 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=10#p10</guid>
		</item>
		<item>
			<title>На заметку</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=9#p9</link>
			<description>&lt;p&gt;&lt;a href=&quot;http://qps.ru/TDyu9&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;На заметку&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Sun, 18 Dec 2016 08:20:38 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=9#p9</guid>
		</item>
		<item>
			<title>Вертолет</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=8#p8</link>
			<description>&lt;div class=&quot;code-box&quot;&gt;&lt;strong class=&quot;legend&quot;&gt;Код:&lt;/strong&gt;&lt;div class=&quot;blockcode&quot;&gt;&lt;div class=&quot;scrollbox&quot; style=&quot;height: 35em&quot;&gt;&lt;pre&gt; Appendix A Helicopter Script
 
 /*  csHelicopter2 written by N. E. Topham 10 Jun 15
 * Based on work by:
 * Andrew Gotow: http://andrewgotow.com/unity3D-helicopter-tutorial/
 * joeybubble1: http://answers.unity3D.com/questions/447776/helicopter-physics-c.html;
 * GAPH: https://www.assetstore.unity3D.com/en/#!/content/27229
 *
 * The script produced a flight model for a helicopter that manoeuvres
 * in a similar manner to a drone.  It auto-hovers and maintains
 * altitude.  The main motor and sub motor game objects, should be
 * mapped to the rotating blade assembly, and ‘rb’ should link to the
 * main rigid body.  Adjusting the climbrate changes the vertical
 * speeds.
 */
 
 using UnityEngine;
 using UnityEngine.UI;
 using System.Collections;
 
 public class csHellicopter2 : MonoBehaviour {
 
 public KeyCode UpKey;
 public KeyCode DownKey;
 public KeyCode FrontSpin;
 public KeyCode BackWardSpin;
 public KeyCode LeftTurn;
 public KeyCode RightTurn;
 public KeyCode LeftSpin;
 public KeyCode RightSpin;
 public KeyCode EngineOnOffKey;
 
 //Helicopter Big Propeller. Use Y Rotate Value.
 public GameObject[] MainMotor; 
 //Helicopter Small Propeller. User X RotateValue.    
 public GameObject[] SubMotor; 
 //Helicopter Engine Sound.
 public AudioSource _AudioSource; 
 
 public float MainMotorRotateVelocity;
 public float SubMotorRotateVelocity;
 
 //Rigidbody variable for controlling drag, high drag needed to retard motion, low drag needed to prevent &#039;floating&#039; when engine is off.
 public Rigidbody rb;        
     
 /*  Not currently used
 * //Text for de-bugging.
 * public GUIElement pitchInputValue;
 * public GUIElement VertV;
 * public GUIElement PitchAngle;
 */
     
 float VerticalVelocity = 0.0f; 
 float MainMotorRotation = 0.0f;
 float SubMotorRotation = 0.0f;
     
 public float ClimbRate;
 float AltitudeInput;
 
 
 //Pitch Values
 float Pitch;
 float PitchInput;
 float forwardSpeed;
 
 
 // Yaw Variables
 float Yaw = 150;
 float LeftRightTurn;
 
 // Roll Variables
 float Roll;
 float LeftRightSpin;
 float sideSpeed;
 
 bool EngineOn = false;
 float EngineValue = 0.0f;
 
 //Runs when script first called
 void start(){
 rb = GetComponent&amp;lt;Rigidbody&amp;gt; ();
     
 }
 
 //Runs every physics step, always a fixed interval, best used for rigidbody physics updates.
 void FixedUpdate(){
     
 //MotorVelocityContorl(); // Check Helicoptor AltitudeInput State
 
 if (EngineOn) {
 //Applies force on the current vertical axis of the Helicopter
 GetComponent&amp;lt;Rigidbody&amp;gt;().AddRelativeForce (Vector3.up * ClimbRate * VerticalVelocity);             
         GetComponent&amp;lt;Rigidbody&amp;gt;().AddRelativeForce (Vector3.right * sideSpeed);
         // additional force to counter altitude loss – note can result in climbing if not at full roll or when used with pitch
 GetComponent&amp;lt;Rigidbody&amp;gt;().AddForce (Vector3.up *Mathf.Abs (sideSpeed*0.33f)); 
         GetComponent&amp;lt;Rigidbody&amp;gt;().AddRelativeForce (Vector3.forward * forwardSpeed);
         GetComponent&amp;lt;Rigidbody&amp;gt;().AddForce (Vector3.up *Mathf.Abs (forwardSpeed*0.33f));
         // High drag to damp motion
 rb.drag = 2;
 
         //Sets Max Altitude
 if (transform.position.y &amp;gt; 500) 
 //At max altitude reverses keyboard input
 GetComponent&amp;lt;Rigidbody&amp;gt;().AddRelativeForce (-Vector3.up * ClimbRate * VerticalVelocity);       
 
             AltitudeInput = KeyValue (DownKey, UpKey);  
 
          PitchInput = KeyValue (BackWardSpin, FrontSpin);
         LeftRightTurn = KeyValue (LeftTurn, RightTurn);
         LeftRightSpin = KeyValue (LeftSpin, RightSpin);
            
         //Pitch Value
         if (PitchInput != 0) {
             Pitch += PitchInput * Time.fixedDeltaTime * 60f;
 //Limits the Pitch to a value of 20. 
 Pitch = Mathf.Clamp (Pitch, -20f, 20f); 
             //additional forwards force to improve lateral movement, adjusting the integer increases the speed.
 forwardSpeed = PitchInput * 7; 
 //Constant initially 50 adjusted to 7 after rescaling SE.
 } else {
     Pitch = Mathf.Lerp (Pitch, 0, Time.fixedDeltaTime * 3.0f);
             // reset forward speed value
 forwardSpeed = 0.0f; 
         }
 
         //Yaw Value
         //Yaw is unlimited allowing 360deg rotation
         Yaw += LeftRightTurn * Time.fixedDeltaTime * 60f;        
 
         //Roll Value
         if (LeftRightSpin != 0) {
             Roll += -LeftRightSpin * Time.fixedDeltaTime * 60f;
             //Limits the roll to a value of 1.2
 Roll = Mathf.Clamp (Roll, -20f, 20f);
 //additional sideways force to improve lateral movement 
             sideSpeed = LeftRightSpin * 7; 
 //Constant initially 50 adjusted to 7 after rescaling SE.
                          
         } else {
             //Smooth the Roll back to 0
 Roll = Mathf.Lerp (Roll, 0, Time.fixedDeltaTime * 3.0f);    
         //Reset the sideSpeed value - note, this line may not be required if the sideSpeed were taken outside of the if statement
 sideSpeed = 0.0f;    
         }
 
 //Transforms from current orientation to desired new rotation, indicated by Pitch Yaw and Roll Values with a 1.5 Second smoothing factor
 transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.Euler (Pitch, Yaw, Roll), Time.fixedDeltaTime * 1.5f);  
             
 
 /* Not Used in main system
         //Debugging outputs 
         PitchAngle.GetComponent&amp;lt;GUIText&amp;gt;().text = &amp;quot;Pitch Angle = &amp;quot; + transform.rotation;
         VertV.GetComponent&amp;lt;GUIText&amp;gt;().text = &amp;quot;Vertical Velocity = &amp;quot; + VerticalVelocity;
         pitchInputValue.GetComponent&amp;lt;GUIText&amp;gt;().text = &amp;quot;Pitch Input =&amp;quot; + PitchInput;
         */
 
     else {
         rb.drag=0;
     }
 }
     
 // Update fires every Frame, time step dependent upon framerate
 void Update (){
 SoundControl(); // Check Helicopter Engine Sound
 MotorRotateControl(); // Check Motor Rotate State
 MotorVelocityContorl(); // Check Helicopter AltitudeInput State
 EngineControl(); // Check Engine Turn On/Off
 }
 
 //Key input script, originally used to smooth inputs, no longer strictly required, but retained to allow future adjustments, maybe required for gesture controls.
 float KeyValue(KeyCode A, KeyCode B){
     
 float Value = 0.0f;
 
 if (Input.GetKey (A))
 Value = -1.0f;
 
     else if (Input.GetKey (B))
 Value = 1.0f;
 
     else
         Value = 0;//As soon as keys are released returns a 0 value
 
 return Value;
 }
 
 void MotorVelocityContorl(){
 
 if (EngineOn){
 //for maintain altitude.
 float Hovering = (Mathf.Abs(GetComponent&amp;lt;Rigidbody&amp;gt;().mass * Physics.gravity.y) / ClimbRate); 
 
 if (AltitudeInput != 0.0f)
 //if Input Up/Down Axes, increase VerticalVelocity for Increase altitude.
                 VerticalVelocity += AltitudeInput * 0.1f; 
             else
             //if no input on Vertical Axes revert to Hovering            VerticalVelocity = Hovering; 
 
 
 /* Original code included a smoothing function to gradually shift to hovering, when combined with the physics inertial effects this resulted in over-smoothing.  
 *  To resolve this the code line below was replaced with &#039;Hovering;&#039;
 * 
 * Mathf.Lerp(VerticalVelocity, Hovering, Time.deltaTime); 
 * 
 * This resulted in improved vertical handling.
 */
 
 }
 CheckVerticalVelocity();
 }
 
 //Prevents verticalVelocitiy exceeding 1
 void CheckVerticalVelocity(){
 if (VerticalVelocity &amp;gt; 1.0f)
 VerticalVelocity = 1.0f;
 else if (VerticalVelocity &amp;lt; -0.5f)
 //When set to zero no reduction in decent speed.
 VerticalVelocity = -0.5f;  
 }
 
 //Spins rotors with smoothed start and stop animation
 void MotorRotateControl(){
 if (MainMotor.Length &amp;gt; 0){
 for (int i = 0; i &amp;lt; MainMotor.Length; i++)
 MainMotor[i].transform.Rotate(0, MainMotorRotation, 0);
 }
 
 if (SubMotor.Length &amp;gt; 0){
 for (int i = 0; i &amp;lt; SubMotor.Length; i++)
 SubMotor[i].transform.Rotate(SubMotorRotation, 0, 0);
 }
 
 MainMotorRotation = MainMotorRotateVelocity * EngineValue * Time.deltaTime;
 SubMotorRotation = SubMotorRotateVelocity * EngineValue * Time.deltaTime;
 }
 
 //Engine Control script, turns the engines on and off.
 void EngineControl(){
 if (Input.GetKeyDown(EngineOnOffKey)){
         if (EngineOn)
 EngineOn = false;
 else
 EngineOn = true;
 }
 
 if (EngineOn == true){
 if (EngineValue &amp;lt; 1)
 EngineValue += Time.deltaTime;
 if (EngineValue &amp;gt;= 1)
 EngineValue = 1;
 }
 
 else if (EngineOn == false){
 if (EngineValue &amp;gt; 0)
 EngineValue -= Time.deltaTime / 2;
 if (EngineValue &amp;lt;= 0)
 EngineValue = 0;
 }
 }
 
 
 //Sound Control script, varies pitch based on engine speed
 void SoundControl(){
 if (EngineValue &amp;gt; 0){
 _AudioSource.mute = false;
 _AudioSource.pitch = EngineValue;
 }
 else
 _AudioSource.mute = true;
 }
 }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Sat, 17 Dec 2016 18:37:27 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=8#p8</guid>
		</item>
		<item>
			<title>Управление самолетом</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=7#p7</link>
			<description>&lt;div class=&quot;code-box&quot;&gt;&lt;strong class=&quot;legend&quot;&gt;Код:&lt;/strong&gt;&lt;div class=&quot;blockcode&quot;&gt;&lt;div class=&quot;scrollbox&quot; style=&quot;height: 35em&quot;&gt;&lt;pre&gt;/// &amp;lt;summary&amp;gt;
/// Player controller.
/// &amp;lt;/summary&amp;gt;
using UnityEngine;
using System.Collections;

[RequireComponent(typeof(FlightSystem))]

public class PlayerController : MonoBehaviour
{
	
	FlightSystem flight;// Core plane system
	FlightView View;
	public bool Active = true;
	public bool SimpleControl;// make it easy to control Plane will turning easier.
	public bool Acceleration;// Mobile*** enabled gyroscope controller
	public float AccelerationSensitivity = 5;// Mobile*** gyroscope sensitivity
	private TouchScreenVal controllerTouch;// Mobile*** move
	private TouchScreenVal fireTouch;// Mobile*** fire
	private TouchScreenVal switchTouch;// Mobile*** swich
	private TouchScreenVal sliceTouch;// Mobile*** slice
	private bool directVelBack;
	public GUISkin skin;
	public bool ShowHowto;

	void Start ()
	{
    flight = this.GetComponent&amp;lt;FlightSystem&amp;gt; ();
    View = (FlightView)GameObject.FindObjectOfType (typeof(FlightView));
    
    
    // setting all Touch screen controller in the position
    controllerTouch = new TouchScreenVal (new Rect (0, 0, Screen.width / 2, Screen.height - 100));
    fireTouch = new TouchScreenVal (new Rect (Screen.width / 2, 0, Screen.width / 2, Screen.height));
    switchTouch = new TouchScreenVal (new Rect (0, Screen.height - 100, Screen.width / 2, 100));
    sliceTouch = new TouchScreenVal (new Rect (0, 0, Screen.width / 2, 50));
    
    if (flight)
    	directVelBack = flight.DirectVelocity;
	}
	
	void Update ()
	{
    if (!flight || !Active)
    	return;
    #if UNITY_EDITOR || UNITY_WEBPLAYER || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
    // On Desktop
    DesktopController();
    #else
    // On Mobile device
    MobileController ();
    #endif
    
	}
	
	void DesktopController ()
	{
    // Desktop controller
    flight.SimpleControl = SimpleControl;
    
    // lock mouse position to the center.
    MouseLock.MouseLocked = true;
    
    flight.AxisControl (new Vector2 (Input.GetAxis (&amp;quot;Mouse X&amp;quot;), Input.GetAxis (&amp;quot;Mouse Y&amp;quot;)));
    if (SimpleControl) {
    	flight.DirectVelocity = false;
    	flight.TurnControl (Input.GetAxis (&amp;quot;Mouse X&amp;quot;));
    } else {
    	flight.DirectVelocity = directVelBack;	
    }

    flight.TurnControl (Input.GetAxis (&amp;quot;Horizontal&amp;quot;));
    flight.SpeedUp (Input.GetAxis (&amp;quot;Vertical&amp;quot;));
    
    
    if (Input.GetButton (&amp;quot;Fire1&amp;quot;)) {
    	flight.WeaponControl.LaunchWeapon ();
    }
    
    if (Input.GetButtonDown (&amp;quot;Fire2&amp;quot;)) {
    	flight.WeaponControl.SwitchWeapon ();
    }
    
    if (Input.GetKeyDown (KeyCode.C)) {
    	if (View)
        View.SwitchCameras ();	
    }	
	}
	
	void MobileController ()
	{
    // Mobile controller
    
    flight.SimpleControl = SimpleControl;
    
    if (Acceleration) {
    	// get axis control from device acceleration
    	Vector3 acceleration = Input.acceleration;
    	Vector2 accValActive = new Vector2 (acceleration.x, (acceleration.y + 0.3f) * 0.5f) * AccelerationSensitivity;
    	flight.FixedX = false;
    	flight.FixedY = false;
    	flight.FixedZ = true;
    	
    	flight.AxisControl (accValActive);
    	flight.TurnControl (accValActive.x);
    } else {
    	flight.FixedX = true;
    	flight.FixedY = false;
    	flight.FixedZ = true;
    	// get axis control from touch screen
    	Vector2 dir = controllerTouch.OnDragDirection (true);
    	dir = Vector2.ClampMagnitude (dir, 1.0f);
    	flight.AxisControl (new Vector2 (dir.x, -dir.y) * AccelerationSensitivity * 0.7f);
    	flight.TurnControl (dir.x * AccelerationSensitivity * 0.3f);
    }
    sliceTouch.OnDragDirection (true);
    // slice speed
    flight.SpeedUp (sliceTouch.slideVal.x);
    
    if (fireTouch.OnTouchPress ()) {
    	flight.WeaponControl.LaunchWeapon ();
    }	
    if (switchTouch.OnTouchPress ()) {
    
    }	
	}
	
	
	// you can remove this part..
	void OnGUI ()
	{
    if (!ShowHowto)
    	return;
    
    if (skin)
    	GUI.skin = skin;
    
    if (GUI.Button (new Rect (20, 150, 200, 40), &amp;quot;Gyroscope &amp;quot; + Acceleration)) {
    	Acceleration = !Acceleration;
    }
    
    if (GUI.Button (new Rect (20, 200, 200, 40), &amp;quot;Change View&amp;quot;)) {
    	if (View)
        View.SwitchCameras ();	
    }
    
    if (GUI.Button (new Rect (20, 250, 200, 40), &amp;quot;Change Weapons&amp;quot;)) {
    	if (flight)
        flight.WeaponControl.SwitchWeapon ();
    }
    
    if (GUI.Button (new Rect (20, 300, 200, 40), &amp;quot;Simple Control &amp;quot; + SimpleControl)) {
    	if (flight)
        SimpleControl = !SimpleControl;
    }
	}

}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Sat, 17 Dec 2016 16:57:18 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=7#p7</guid>
		</item>
		<item>
			<title>Видео уроки</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=6#p6</link>
			<description>&lt;p&gt;&lt;a href=&quot;http://qps.ru/vgxGu&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;BurgZerg Arcade&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Fri, 16 Dec 2016 16:50:01 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=6#p6</guid>
		</item>
		<item>
			<title>Каналы на You Tube</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=5#p5</link>
			<description>&lt;p&gt;&lt;a href=&quot;http://qps.ru/iSPl7&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Brackeys&lt;/a&gt;&lt;/p&gt;
						&lt;p&gt;&lt;a href=&quot;http://qps.ru/xqCWu&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Gamer To Game Developer&lt;/a&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Fri, 16 Dec 2016 16:47:47 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=5#p5</guid>
		</item>
		<item>
			<title>WoW Camera</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=4#p4</link>
			<description>&lt;div class=&quot;code-box&quot;&gt;&lt;strong class=&quot;legend&quot;&gt;Код:&lt;/strong&gt;&lt;div class=&quot;blockcode&quot;&gt;&lt;div class=&quot;scrollbox&quot; style=&quot;height: 35em&quot;&gt;&lt;pre&gt;using UnityEngine;
using System.Collections;

public class WowCamera : MonoBehaviour
{
	public Transform target;

	public float targetHeight = 1.7f;
	public float distance = 5.0f;
	public float offsetFromWall = 0.1f;

	public float maxDistance = 20;
	public float minDistance = .6f;
	public float speedDistance = 5;

	public float xSpeed = 200.0f;
	public float ySpeed = 200.0f;

	public int yMinLimit = -40;
	public int yMaxLimit = 80;

	public int zoomRate = 40;

	public float rotationDampening = 3.0f;
	public float zoomDampening = 5.0f;

	public LayerMask collisionLayers = -1;

	private float xDeg = 0.0f;
	private float yDeg = 0.0f;
	private float currentDistance;
	private float desiredDistance;
	private float correctedDistance;

	void Start ()
	{
    Vector3 angles = transform.eulerAngles;
    xDeg = angles.x;
    yDeg = angles.y;

    currentDistance = distance;
    desiredDistance = distance;
    correctedDistance = distance;

    // Make the rigid body not change rotation
    if (this.gameObject.GetComponent&amp;lt;Rigidbody&amp;gt;())
    	this.gameObject.GetComponent&amp;lt;Rigidbody&amp;gt;().freezeRotation = true;
	}

	/**
     * Camera logic on LateUpdate to only update after all character movement logic has been handled.
     */
	void LateUpdate ()
	{
    Vector3 vTargetOffset;

    // Don&#039;t do anything if target is not defined
    if (!target)
    	return;

    // If either mouse buttons are down, let the mouse govern camera position
    if (GUIUtility.hotControl == 0) {
    	if (Input.GetMouseButton(0) || Input.GetMouseButton(1))
    	{
        xDeg += Input.GetAxis (&amp;quot;Mouse X&amp;quot;) * xSpeed * 0.02f;
        yDeg -= Input.GetAxis (&amp;quot;Mouse Y&amp;quot;) * ySpeed * 0.02f;
    	}

    	// otherwise, ease behind the target if any of the directional keys are pressed
    	else if (Input.GetAxis(&amp;quot;Vertical&amp;quot;) != 0 || Input.GetAxis(&amp;quot;Horizontal&amp;quot;) != 0)
    	{
        float targetRotationAngle = target.eulerAngles.y;
        float currentRotationAngle = transform.eulerAngles.y;
        xDeg = Mathf.LerpAngle (currentRotationAngle, targetRotationAngle, rotationDampening * Time.deltaTime);
    	}
    }


    // calculate the desired distance
    desiredDistance -= Input.GetAxis (&amp;quot;Mouse ScrollWheel&amp;quot;) * Time.deltaTime * zoomRate * Mathf.Abs (desiredDistance) * speedDistance;
    desiredDistance = Mathf.Clamp (desiredDistance, minDistance, maxDistance);

    yDeg = ClampAngle(yDeg, yMinLimit, yMaxLimit);

    // set camera rotation
    Quaternion rotation = Quaternion.Euler(yDeg, xDeg, 0);
    correctedDistance = desiredDistance;

    // calculate desired camera position
    vTargetOffset = new Vector3 (0, -targetHeight, 0);
    Vector3 position = target.position - (rotation * Vector3.forward * desiredDistance + vTargetOffset);

    // check for collision using the true target&#039;s desired registration point as set by user using height
    RaycastHit collisionHit;
    Vector3 trueTargetPosition = new Vector3(target.position.x, target.position.y, target.position.z) - vTargetOffset;

    // if there was a collision, correct the camera position and calculate the corrected distance
    bool isCorrected = false;
    if (Physics.Linecast (trueTargetPosition, position, out collisionHit, collisionLayers.value))
    {
    	// calculate the distance from the original estimated position to the collision location,
    	// subtracting out a safety &amp;quot;offset&amp;quot; distance from the object we hit.  The offset will help
    	// keep the camera from being right on top of the surface we hit, which usually shows up as
    	// the surface geometry getting partially clipped by the camera&#039;s front clipping plane.
    	correctedDistance = Vector3.Distance (trueTargetPosition, collisionHit.point) - offsetFromWall;
    	isCorrected = true;
    }

    // For smoothing, lerp distance only if either distance wasn&#039;t corrected, or correctedDistance is more than currentDistance
    currentDistance = !isCorrected || correctedDistance &amp;gt; currentDistance ? Mathf.Lerp (currentDistance, correctedDistance, Time.deltaTime * zoomDampening) : correctedDistance;

    // keep within legal limits
    currentDistance = Mathf.Clamp (currentDistance, minDistance, maxDistance);

    // recalculate position based on the new currentDistance
    position = target.position - (rotation * Vector3.forward * currentDistance + vTargetOffset);

    transform.rotation = rotation;
    transform.position = position;
	}

	private static float ClampAngle (float angle, float min, float max)
	{
    if (angle &amp;lt; -360)
    	angle += 360;
    if (angle &amp;gt; 360)
    	angle -= 360;
    return Mathf.Clamp (angle, min, max);
	}
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Fri, 16 Dec 2016 16:39:58 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=4#p4</guid>
		</item>
		<item>
			<title>Движение в точку клика и Mecanim</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=3#p3</link>
			<description>&lt;div class=&quot;code-box&quot;&gt;&lt;strong class=&quot;legend&quot;&gt;Код:&lt;/strong&gt;&lt;div class=&quot;blockcode&quot;&gt;&lt;div class=&quot;scrollbox&quot; style=&quot;height: 35em&quot;&gt;&lt;pre&gt;    using UnityEngine;
    using System.Collections;
     
    [RequireComponent (typeof (Animator))]
     
    public class CharControlAnim : MonoBehaviour {
     
        private Transform myTransform;              // this transform
        private Vector3 destinationPosition;        // The destination Point
        private float destinationDistance;          // The distance between myTransform and destinationPosition
        public float Speed;                         // Speed at which the character moves
        public float Direction;                    // The Speed the character will move
        public float moveAnimSpeed;                // Float trigger for Float created in Mecanim (Use this to trigger transitions.
        public float animSpeed = 1.5f;            // Animation Speed
        public Animator anim;                     // Animator to Anim converter
        public int idleState = Animator.StringToHash(&amp;quot;Base Layer.Idle&amp;quot;); // String to Hash conversion for Mecanim &amp;quot;Base Layer&amp;quot;
        public int runState = Animator.StringToHash(&amp;quot;Base Layer.Run&amp;quot;);  // String to Hash for Mecanim &amp;quot;Base Layer Run&amp;quot;
        private AnimatorStateInfo currentBaseState;         // a reference to the current state of the animator, used for base layer
        private Collider col;
       
           
     
     
        void Start () {
           
            Physics.gravity = new Vector3(0,-200f,0); // used In conjunction with RigidBody for better Gravity (Freeze Rotation X,Y,Z), set mass and use Gravity)
            anim = GetComponent&amp;lt;Animator&amp;gt;();
            idleState = Animator.StringToHash(&amp;quot;Idle&amp;quot;); // Duplicate added due to Bug
            runState = Animator.StringToHash(&amp;quot;Run&amp;quot;);
            myTransform = transform;                            // sets myTransform to this GameObject.transform
            destinationPosition = myTransform.position;
                              // prevents myTransform reset
        }
     
        void FixedUpdate () {
     
            // keep track of the distance between this gameObject and destinationPosition      
           
            currentBaseState = anim.GetCurrentAnimatorStateInfo(0);
           
            destinationDistance = Vector3.Distance(destinationPosition, myTransform.position);
                   
                     // Set&#039;s speed in reference to distance
       
                if(destinationDistance &amp;lt; .5f){     
                Speed = 0;
            }
            else if(destinationDistance &amp;gt; .5f){        
                Speed = 8;
           
                //Below sends Floats to Mecanim, Raycast set&#039;s speed to X until destination is reached animation is played until speed drops
            }
             
            if (Speed &amp;gt; .5f){
            anim.SetFloat (&amp;quot;moveAnimSpeed&amp;quot;, 2.0f);}
               
                    else if (Speed &amp;lt; .5f){
            anim.SetFloat (&amp;quot;moveAnimSpeed&amp;quot;, 0.0f);} //
     
     
            // Moves the Player if the Left Mouse Button was clicked
           
           
            if (Input.GetMouseButtonDown(0) GUIUtility.hotControl ==0) {
     
                Plane playerPlane = new Plane(Vector3.up, myTransform.position);
                Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                float hitdist = 0.0f;
     
                if (playerPlane.Raycast(ray, out hitdist)) {
                    Vector3 targetPoint = ray.GetPoint(hitdist);
                    destinationPosition = ray.GetPoint(hitdist);
                    Quaternion targetRotation = Quaternion.LookRotation(targetPoint - transform.position);
                    myTransform.rotation = targetRotation;
                   
                   
                }
       
                    }  
           
       
           
     
            // Moves the player if the mouse button is hold down
            else if (Input.GetMouseButton(0) GUIUtility.hotControl ==0) {
     
                Plane playerPlane = new Plane(Vector3.up, myTransform.position);
                Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                float hitdist = 0.0f;
     
                if (playerPlane.Raycast(ray, out hitdist)) {
                    Vector3 targetPoint = ray.GetPoint(hitdist);
                    destinationPosition = ray.GetPoint(hitdist);
                    Quaternion targetRotation = Quaternion.LookRotation(targetPoint - transform.position);
                    myTransform.rotation = targetRotation;
                }
            //  myTransform.position = Vector3.MoveTowards(myTransform.position, destinationPosition, moveSpeed * Time.deltaTime);
            }
     
            // To prevent code from running if not needed
            if(destinationDistance &amp;gt; .5f){
                myTransform.position = Vector3.MoveTowards(myTransform.position, destinationPosition, Speed * Time.deltaTime);
            }
        }
    }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Fri, 16 Dec 2016 16:27:12 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=3#p3</guid>
		</item>
		<item>
			<title>Движение в точку клика</title>
			<link>https://crazybyte.7bb.ru/viewtopic.php?pid=2#p2</link>
			<description>&lt;p&gt;&lt;a href=&quot;http://qps.ru/O3GuK&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Движение в точку клика&lt;/a&gt;&lt;/p&gt;
						&lt;p&gt;Видео:&lt;br /&gt;&lt;/p&gt;
						&lt;p&gt;Код к уроку:&lt;/p&gt;&lt;div class=&quot;code-box&quot;&gt;&lt;strong class=&quot;legend&quot;&gt;Код:&lt;/strong&gt;&lt;div class=&quot;blockcode&quot;&gt;&lt;div class=&quot;scrollbox&quot; style=&quot;height: 35em&quot;&gt;&lt;pre&gt;using UnityEngine;
using System.Collections;

namespace CompleteProject
{

    public class ClickToMove : MonoBehaviour {

        public float shootDistance = 10f;
        public float shootRate = .5f;
        public PlayerShooting shootingScript;

        private Animator anim;
        private NavMeshAgent navMeshAgent;
        private Transform targetedEnemy;
        private Ray shootRay;
        private RaycastHit shootHit;
        private bool walking;
        private bool enemyClicked;
        private float nextFire;

        // Use this for initialization
        void Awake () 
        {
            anim = GetComponent&amp;lt;Animator&amp;gt; ();
            navMeshAgent = GetComponent&amp;lt;NavMeshAgent&amp;gt; ();
        }
        
        // Update is called once per frame
        void Update () 
        {
            Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
            RaycastHit hit;
            if (Input.GetButtonDown (&amp;quot;Fire2&amp;quot;)) 
            {
                if (Physics.Raycast(ray, out hit, 100))
                {
                    if (hit.collider.CompareTag(&amp;quot;Enemy&amp;quot;))
                    {
                        targetedEnemy = hit.transform;
                        enemyClicked = true;
                    }

                    else
                    {
                        walking = true;
                        enemyClicked = false;
                        navMeshAgent.destination = hit.point;
                        navMeshAgent.Resume();
                    }
                }
            }

            if (enemyClicked) {
                MoveAndShoot();
            }

            if (navMeshAgent.remainingDistance &amp;lt;= navMeshAgent.stoppingDistance) {
                if (!navMeshAgent.hasPath || Mathf.Abs (navMeshAgent.velocity.sqrMagnitude) &amp;lt; float.Epsilon)
                walking = false;
            } else {
                walking = true;
            }

            anim.SetBool (&amp;quot;IsWalking&amp;quot;, walking);
        }

        private void MoveAndShoot()
        {
            if (targetedEnemy == null)
                return;
            navMeshAgent.destination = targetedEnemy.position;
            if (navMeshAgent.remainingDistance &amp;gt;= shootDistance) {
            
                navMeshAgent.Resume();
                walking = true;
            }

            if (navMeshAgent.remainingDistance &amp;lt;= shootDistance) {
            
                transform.LookAt(targetedEnemy);
                Vector3 dirToShoot = targetedEnemy.transform.position - transform.position;
                if (Time.time &amp;gt; nextFire)
                {
                    nextFire = Time.time + shootRate;
                    shootingScript.Shoot(dirToShoot);
                }
                navMeshAgent.Stop();
                walking = false;
            }
        }

    }

}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
			<author>mybb@mybb.ru (crazy_Byte)</author>
			<pubDate>Fri, 16 Dec 2016 16:18:34 +0300</pubDate>
			<guid>https://crazybyte.7bb.ru/viewtopic.php?pid=2#p2</guid>
		</item>
	</channel>
</rss>
