<?xml version="1.0" encoding="windows-1251"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://lunity.hutt.live/export.php?type=rss" rel="self" type="application/rss+xml" />
		<title>Программы+языки</title>
		<link>https://lunity.hutt.live/</link>
		<description>Программы+языки</description>
		<language>ru-ru</language>
		<lastBuildDate>Wed, 15 Jan 2014 09:38:26 +0400</lastBuildDate>
		<generator>MyBB/mybb.ru</generator>
		<item>
			<title>Мультиплеер</title>
			<link>https://lunity.hutt.live/viewtopic.php?pid=19#p19</link>
			<description>&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;/** 
 * Script made by OMA [www.oma.netau.net] 
 **/ 

 var concrete : AudioClip[]; 
 var wood : AudioClip[]; 
 var dirt : AudioClip[]; 
 var metal : AudioClip[]; 
 private var step : boolean = true; 
 var audioStepLengthWalk : float = 0.45; 
 var audioStepLengthRun : float = 0.25; 

 function OnControllerColliderHit (hit : ControllerColliderHit) { 
 var controller : CharacterController = GetComponent(CharacterController); 

 if (controller.isGrounded &amp;amp;&amp;amp; controller.velocity.magnitude &amp;lt; 8 &amp;amp;&amp;amp; controller.velocity.magnitude &amp;gt; 1 &amp;amp;&amp;amp; hit.gameObject.tag == &amp;quot;Concrete&amp;quot;  &amp;amp;&amp;amp; step == true || controller.isGrounded &amp;amp;&amp;amp; controller.velocity.magnitude &amp;lt; 1 &amp;amp;&amp;amp; controller.velocity.magnitude &amp;gt; 1 &amp;amp;&amp;amp; hit.gameObject.tag == &amp;quot;Untagged&amp;quot; &amp;amp;&amp;amp; step == true ) { 
    WalkOnConcrete(); 
   } else if (controller.isGrounded &amp;amp;&amp;amp; controller.velocity.magnitude &amp;gt; 3 &amp;amp;&amp;amp; hit.gameObject.tag == &amp;quot;Concrete&amp;quot; &amp;amp;&amp;amp; step == true || controller.isGrounded &amp;amp;&amp;amp; controller.velocity.magnitude &amp;gt; 3 &amp;amp;&amp;amp; hit.gameObject.tag == &amp;quot;Untagged&amp;quot; &amp;amp;&amp;amp; step == true) { 
    RunOnConcrete(); 
   } else if (controller.isGrounded &amp;amp;&amp;amp; controller.velocity.magnitude &amp;lt; 3 &amp;amp;&amp;amp; controller.velocity.magnitude &amp;gt; 5 &amp;amp;&amp;amp; hit.gameObject.tag == &amp;quot;Wood&amp;quot; &amp;amp;&amp;amp; step == true) { 
    WalkOnWood(); 
   } else if (controller.isGrounded &amp;amp;&amp;amp; controller.velocity.magnitude &amp;gt; 1 &amp;amp;&amp;amp; hit.gameObject.tag == &amp;quot;Wood&amp;quot; &amp;amp;&amp;amp; step == true) { 
    RunOnWood(); 
   } else if (controller.isGrounded &amp;amp;&amp;amp; controller.velocity.magnitude &amp;lt; 7 &amp;amp;&amp;amp; controller.velocity.magnitude &amp;gt; 1 &amp;amp;&amp;amp; hit.gameObject.tag == &amp;quot;Dirt&amp;quot; &amp;amp;&amp;amp; step == true) { 
    WalkOnDirt(); 
   } else if (controller.isGrounded &amp;amp;&amp;amp; controller.velocity.magnitude &amp;gt; 8 &amp;amp;&amp;amp; hit.gameObject.tag == &amp;quot;Dirt&amp;quot; &amp;amp;&amp;amp; step == true) { 
    RunOnDirt(); 
   } else if (controller.isGrounded &amp;amp;&amp;amp; controller.velocity.magnitude &amp;lt; 7 &amp;amp;&amp;amp; controller.velocity.magnitude &amp;gt; 1 &amp;amp;&amp;amp; hit.gameObject.tag == &amp;quot;Metal&amp;quot; &amp;amp;&amp;amp; step == true) { 
    WalkOnMetal(); 
   } else if (controller.isGrounded &amp;amp;&amp;amp; controller.velocity.magnitude &amp;gt; 8 &amp;amp;&amp;amp; hit.gameObject.tag == &amp;quot;Metal&amp;quot; &amp;amp;&amp;amp; step == true) { 
    RunOnMetal();    
   }   
 } 

 /////////////////////////////////// CONCRETE //////////////////////////////////////// 
 function WalkOnConcrete() { 
   step = false; 
   audio.clip = concrete[Random.Range(0, concrete.length)]; 
   audio.volume = 99.9; 
   audio.Play(); 
   yield WaitForSeconds (audioStepLengthWalk); 
   step = true; 
 } 

 function RunOnConcrete() { 
   step = false; 
   audio.clip = concrete[Random.Range(0, concrete.length)]; 
   audio.volume = 99.9; 
   audio.Play(); 
   yield WaitForSeconds (audioStepLengthRun); 
   step = true; 
 }   

 ////////////////////////////////// WOOD ///////////////////////////////////////////// 
 function WalkOnWood() { 
   step = false; 
   audio.clip = wood[Random.Range(0, wood.length)]; 
   audio.volume = 79.1; 
   audio.Play(); 
   yield WaitForSeconds (audioStepLengthWalk); 
   step = true; 
 } 

 function RunOnWood() { 
   step = false; 
   audio.clip = wood[Random.Range(0, wood.length)]; 
   audio.volume = 79.1; 
   audio.Play(); 
   yield WaitForSeconds (audioStepLengthRun); 
   step = true; 
 } 

 /////////////////////////////////// DIRT ////////////////////////////////////////////// 
 function WalkOnDirt() { 
   step = false; 
   audio.clip = dirt[Random.Range(0, dirt.length)]; 
   audio.volume = 99.1; 
   audio.Play(); 
   yield WaitForSeconds (audioStepLengthWalk); 
   step = true; 
 } 

 function RunOnDirt() { 
   step = false; 
   audio.clip = dirt[Random.Range(0, dirt.length)]; 
   audio.volume = 99.3; 
   audio.Play(); 
   yield WaitForSeconds (audioStepLengthRun); 
   step = true; 
 } 

 ////////////////////////////////// METAL /////////////////////////////////////////////// 
 function WalkOnMetal() {   
   step = false; 
   audio.clip = metal[Random.Range(0, metal.length)]; 
   audio.volume = 99.1; 
   audio.Play(); 
   yield WaitForSeconds (audioStepLengthWalk); 
   step = true; 
 } 

 function RunOnMetal() { 
   step = false; 
   audio.clip = metal[Random.Range(0, metal.length)]; 
   audio.volume = 99.3; 
   audio.Play(); 
   yield WaitForSeconds (audioStepLengthRun); 
   step = true; 
 } 

 @script RequireComponent(AudioSource)&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Этот скрипт позволяет создать в вашем проекте звук шагов!Он да же меняет звуки шагов при ходьбе по определенным материалам!Тоесть идете по дереву(звук дерева) идете по металлу(звук металла) но чтобы слышались разные звуки ходьбы вам нужно помечать их тегами!Создайте теги : Metal,Wood,Dirt &lt;br /&gt;этими тегами вы будете помечать поверхности,например: Wood тегом пометьте ту поверхность где дерево ну и т.д &lt;br /&gt;В скрипте так же нужно чут чуть разобраться, например: чтобы менять скорость шагов и громкость. &lt;br /&gt;Думаю особого труда разобраться не заставит. &lt;br /&gt;Откуда брал не помню.Вроде из Fps Kit. &lt;/p&gt;
						&lt;p&gt;Скрипт &amp;quot;Foot Steps&amp;quot;.&lt;/p&gt;</description>
			<author>mybb@mybb.ru (Ohlopkoff1)</author>
			<pubDate>Wed, 15 Jan 2014 09:38:26 +0400</pubDate>
			<guid>https://lunity.hutt.live/viewtopic.php?pid=19#p19</guid>
		</item>
		<item>
			<title>Сборник скриптов прямо здесь</title>
			<link>https://lunity.hutt.live/viewtopic.php?pid=13#p13</link>
			<description>&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; /*//////////////////////////////////////////*/ 
 /*/////////////////Sector13////////////////*/ 
 /*/////////////////////////////////////////*/ 

 var projectile : Rigidbody; 
 var speed = 20; 
 var Potrons = 5; 
 private var Timer : float = 0.0;         
 private var TimerFire : float = 0.0; 
 var Damage = 50; 

 function OnGUI () { 
           windowRect = GUI.Window (0, Rect (20, 20, 200, 50), DoMyWindow, &amp;quot;Сила: &amp;quot; + Timer); 
           GUI.Label(new Rect(30,450,250,30),&amp;quot; Гранаты: &amp;quot; + Potrons); 
 } 

 function DoMyWindow (windowID : int) { 
 GUI.HorizontalSlider (Rect (10, 25, 180, 45), Timer, 0.0, 1); 
 } 

 function Update() 
 { 
               if( Input.GetKey(&amp;quot;q&amp;quot;)) 
               if(Potrons &amp;gt;=1) 
               { 
             Timer += Time.deltaTime;         
          if (Timer &amp;gt;=1) 
          { 
          Timer = 1; 
          } 
         } 
         if( Input.GetKeyUp(&amp;quot;q&amp;quot;)) 
         if(Potrons &amp;gt;=1) 
               { 
         TimerFire += (Timer*1.5) * speed; 
         Potrons -= 1; 
         var instantiatedProjectile : Rigidbody = Instantiate( projectile, transform.position, transform.rotation ); 
         instantiatedProjectile.velocity = transform.TransformDirection( Vector3( 0, 0, TimerFire ) );        
         Physics.IgnoreCollision( instantiatedProjectile. collider, transform.root.collider );         
         Timer = 0.0;         
         TimerFire = 0.0; 
         }         
 }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
			<author>mybb@mybb.ru (Ohlopkoff1)</author>
			<pubDate>Wed, 15 Jan 2014 08:51:57 +0400</pubDate>
			<guid>https://lunity.hutt.live/viewtopic.php?pid=13#p13</guid>
		</item>
		<item>
			<title>Аи турели</title>
			<link>https://lunity.hutt.live/viewtopic.php?pid=11#p11</link>
			<description>&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;var projectile : Rigidbody; 
var shootAngleDistance = 10.0;
var bulspeed=700;
var target : Transform;
var reloadTime = 0.5; 
var ammoCount = 2000;
private var lastShot = -10.0;

function Start () 
{
   if (target == null &amp;amp;&amp;amp; GameObject.FindWithTag(&amp;quot;Player&amp;quot;))
   target = GameObject.FindWithTag(&amp;quot;Player&amp;quot;).transform;
}
function Update () 
{ 
   if (target == null) 
   return;
   var targetvelocity=target.rigidbody.velocity;
   var Distance =Vector3.Distance(transform.position, target.position) ;
   var targetPoint = Vector3(target.position.x+targetvelocity.x*Mathf.Sqrt(Mathf.Pow(Distance,2)/(Mathf.Pow(bulspeed,2)-Mathf.Pow(targetvelocity.x,2))),target.position.y+targetvelocity.y*Mathf.Sqrt(Mathf.Pow(Distance,2)/(Mathf.Pow(bulspeed,2)-Mathf.Pow(targetvelocity.y,2))),target.position.z+targetvelocity.z*Mathf.Sqrt(Mathf.Pow(Distance,2)/(Mathf.Pow(bulspeed,2)-Mathf.Pow(targetvelocity.z,2))));//Поправку берём тут
   var targetRotation = Quaternion.LookRotation (targetPoint-transform.position, Vector3(0,1,0));
   transform.rotation = Quaternion.Slerp(
   transform.rotation, targetRotation, Time.deltaTime * 2.0);
   var forward = transform.TransformDirection(Vector3.forward); 
   var targetDir = target.position - transform.position; 
   if (Vector3.Angle(forward, targetDir) &amp;lt; shootAngleDistance) 
   BroadcastMessage(&amp;quot;Fire&amp;quot;);
   //Debug.DrawLine( transform.position, transform.position+forward*1000, Color.red);

}
function Fire ()
{
if (Time.time &amp;gt; reloadTime + lastShot &amp;amp;&amp;amp; ammoCount &amp;gt; 0)
   {
   var instantiatedProjectile : Rigidbody = Instantiate (projectile, Vector3(transform.position.x,transform.position.y,transform.position.z+20), transform.rotation);
   instantiatedProjectile.velocity = transform.TransformDirection(Vector3(0,0,bulspeed));
   lastShot = Time.time; 
   ammoCount-- ;
   }
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
			<author>mybb@mybb.ru (Ohlopkoff1)</author>
			<pubDate>Wed, 15 Jan 2014 07:58:29 +0400</pubDate>
			<guid>https://lunity.hutt.live/viewtopic.php?pid=11#p11</guid>
		</item>
		<item>
			<title>Делаем MP3-плеер в Unity3D</title>
			<link>https://lunity.hutt.live/viewtopic.php?pid=9#p9</link>
			<description>&lt;p&gt;Всем привет! И это снова я! Сейчас мы будем делать mp3 плеер с переключением треков в Unity! Итак... Приступим! &lt;br /&gt;Сначала укажем, AudioSource, который будет нашим плеером (AudioSource - источник звука). Но до этого его нужно сделать в редакторе (Component =&amp;gt; Audio =&amp;gt; AudioSource). И пишем скрипт (C#). Укажем преременную AudioSource:&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: 4.5em&quot;&gt;&lt;pre&gt;public AudioSource pleer;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Тут мы в инспекторе объявим наш AudioSource в переменную. Теперь укажем переменную треков в плеере:&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: 4.5em&quot;&gt;&lt;pre&gt;public AudioClip[] treks;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Мы поставили &amp;quot;[]&amp;quot; для того, чтобы в инспекторе же указывать количество треков. &lt;br /&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: 6em&quot;&gt;&lt;pre&gt;int currentTrek = 0; 
int numberTrek;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;currentTrek - это переменная, отвечающая за играющий трек, а numberTrek - (всё и так понятно) номер трека. &lt;br /&gt;Теперь создадим метод (void) Awake(), и укажем, чему равен номер нашего трека: &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: 9em&quot;&gt;&lt;pre&gt;void Awake() 
{ 
numberTrek = treks.Length - 1; 
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Мы указали, что numberTrek - это количество треков, но буз одного. &lt;br /&gt;Теперь делаем метод (void) Update():&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: 21em&quot;&gt;&lt;pre&gt;void Update() 
{ 
if (Input.GetKeyDown(KeyCode.Z)) 
{ 
pleer.Play(); 
} 

if (Input.GetKeyDown(KeyCode.X)) 
{ 
pleer.Stop(); 
} 
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Тут мы сделали запуск и остановку нашего AudioSource. Запуск будет происходить по нажатию &amp;quot;Z&amp;quot;, а остановка по нажатию &amp;quot;X&amp;quot;. &lt;br /&gt;Создадим новый метод с числовой переменной в нём. Переключатель треков. Это будет метод (void) SelectTrek(int i): &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: 18em&quot;&gt;&lt;pre&gt;void SelectTrek(int i) 
{ 
for (int cnt = 0; cnt &amp;lt; treks.Length; cnt++) 
{ 
if (cnt == i) 
{ 
pleer.clip = treks[cnt]; 
} 
} 
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Итак... Сейчас я объясню, что написано в методе. Мы создали цикл с числовой переменной cnt. Указали, что она меньше количества треков и прибавляли её. Дальше мы ставим условие, если cnt равно i! И если они равны, то у нашего AudioSource &amp;quot;pleer&amp;quot; клип - это переменная treks с номером переменной cnt. &lt;br /&gt;Теперь возвращаемся в метод (void) Update(), и пишем условия переключения: &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: 16.5em&quot;&gt;&lt;pre&gt;if (Input.GetKeyDown(KeyCode.B)) 
{ 
if (currentTrek + 1 &amp;lt;= numberTrek) 
{ 
currentTrek++; 
SelectTrek(currentTrek); 
pleer.Play(); 
} 
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Тут мы поставили условие, если нажата кнопка &amp;quot;B&amp;quot;. И в условии второе условие, если currentTrek + 1 меньше или равно numberTrek, то currentTrek увеличивается на один, переменная в SelectTrek() i равна currentTrek, и запускаем AudioSource. Почти таким же образом делаем перемотку трека назад, но мы сделаем условие в else: &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: 15em&quot;&gt;&lt;pre&gt;else if(Input.GetKeyDown(KeyCode.V)) 
{ 
if (currentTrek - 1 &amp;gt;= 0) 
{ 
currentTrek--; 
SelectTrek(currentTrek); 
pleer.Play(); 
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Тут мы уменьшаем переменную текущего трека. А теперь ставим ещё одно else:&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: 10.5em&quot;&gt;&lt;pre&gt;else 
{ 
currentTrek = numberTrek; 
SelectTrek(currentTrek); 
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Тут мы возвращаем значения. &lt;br /&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;

public class MP3Pleer : MonoBehaviour {
    public AudioSource pleer;
    int currentTrek = 0;
    int numberTrek;
    public AudioClip[] treks;

 void Awake () {
        numberTrek = treks.Length - 1;
 }
 

 void Update () {
        if (Input.GetKeyDown(KeyCode.Z))
        {
            pleer.Play();
        }

        if (Input.GetKeyDown(KeyCode.X))
        {
            pleer.Stop();
        }

        if (Input.GetKeyDown(KeyCode.B))
        {
            if (currentTrek + 1 &amp;lt;= numberTrek)
            {
                currentTrek++;
                SelectTrek(currentTrek);
                pleer.Play();
            }
        }
        else if(Input.GetKeyDown(KeyCode.V))
        {
            if (currentTrek - 1 &amp;gt;= 0)
            {
                currentTrek--;
                SelectTrek(currentTrek);
                pleer.Play();
            }
            else
            {
                currentTrek = numberTrek;
                SelectTrek(currentTrek);
            }
        }
 }

    void SelectTrek(int index)
    {
        for (int cnt = 0; cnt &amp;lt; treks.Length; cnt++)
        {
            if (cnt == index)
            {
                pleer.clip = treks[cnt];
            }
        }
    }
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Теги: MP3, плеер&lt;/p&gt;</description>
			<author>mybb@mybb.ru (Ohlopkoff1)</author>
			<pubDate>Tue, 14 Jan 2014 14:59:38 +0400</pubDate>
			<guid>https://lunity.hutt.live/viewtopic.php?pid=9#p9</guid>
		</item>
		<item>
			<title>Мелочи в редакторе Unity3d</title>
			<link>https://lunity.hutt.live/viewtopic.php?pid=8#p8</link>
			<description>&lt;p&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (Ohlopkoff1)</author>
			<pubDate>Mon, 13 Jan 2014 21:57:15 +0400</pubDate>
			<guid>https://lunity.hutt.live/viewtopic.php?pid=8#p8</guid>
		</item>
		<item>
			<title>Урок JS #2</title>
			<link>https://lunity.hutt.live/viewtopic.php?pid=7#p7</link>
			<description>&lt;p&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (Ohlopkoff1)</author>
			<pubDate>Mon, 13 Jan 2014 21:54:58 +0400</pubDate>
			<guid>https://lunity.hutt.live/viewtopic.php?pid=7#p7</guid>
		</item>
		<item>
			<title>Урок JS #1</title>
			<link>https://lunity.hutt.live/viewtopic.php?pid=6#p6</link>
			<description>&lt;p&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (Ohlopkoff1)</author>
			<pubDate>Mon, 13 Jan 2014 21:54:11 +0400</pubDate>
			<guid>https://lunity.hutt.live/viewtopic.php?pid=6#p6</guid>
		</item>
		<item>
			<title>Unity3D Урок 1 - Пример игры Unity3D [Создание простой сцены]</title>
			<link>https://lunity.hutt.live/viewtopic.php?pid=5#p5</link>
			<description>&lt;p&gt;&lt;/p&gt;</description>
			<author>mybb@mybb.ru (Ohlopkoff1)</author>
			<pubDate>Mon, 13 Jan 2014 21:53:20 +0400</pubDate>
			<guid>https://lunity.hutt.live/viewtopic.php?pid=5#p5</guid>
		</item>
		<item>
			<title>Дистанция до Врага</title>
			<link>https://lunity.hutt.live/viewtopic.php?pid=4#p4</link>
			<description>&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: 31.5em&quot;&gt;&lt;pre&gt;using UnityEngine;
using System.Collections;

public class PlayerUI : MonoBehaviour {

    public Transform other; // Создаем переменную типа Transform(ДЛЯ ВРАГА)
      
    void OnUpdate() // Функция Апдейт
    {
        
        float dist = Vector3.Distance(other.position, transform.position); // Позиция до нашего врага 
        if(dist &amp;lt; 5)                                  // Если позиция до нашего врага меньше 5,то..
        {
            
            print(&amp;quot;Получилось&amp;quot;); //Выводим в консоль Получилось
        }
    
    }
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Теги: Враг, Дистанция&lt;/p&gt;</description>
			<author>mybb@mybb.ru (Ohlopkoff1)</author>
			<pubDate>Mon, 13 Jan 2014 21:49:28 +0400</pubDate>
			<guid>https://lunity.hutt.live/viewtopic.php?pid=4#p4</guid>
		</item>
		<item>
			<title>Убираем Курсор в Игре</title>
			<link>https://lunity.hutt.live/viewtopic.php?pid=3#p3</link>
			<description>&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: 22.5em&quot;&gt;&lt;pre&gt;using UnityEngine;
using System.Collections;

public class PlayerUI : MonoBehaviour {

    public Transform other;
    

    void Awake() //При запуске сцены
    {
        Screen.showCursor = false; // Убираем курсор
    }
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Скрипт JS:&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: 9em&quot;&gt;&lt;pre&gt;function Awake()
{
Screen.showCursor = false;
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Теги: Курсор&lt;/p&gt;</description>
			<author>mybb@mybb.ru (Ohlopkoff1)</author>
			<pubDate>Mon, 13 Jan 2014 21:48:06 +0400</pubDate>
			<guid>https://lunity.hutt.live/viewtopic.php?pid=3#p3</guid>
		</item>
		<item>
			<title>Генерация Мира</title>
			<link>https://lunity.hutt.live/viewtopic.php?pid=2#p2</link>
			<description>&lt;p&gt;Скрипт JS:&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: 33em&quot;&gt;&lt;pre&gt;var prefab : Transform; 
var height : Transform; 

var Area = 20; 
static var rand = 0;
static var rand2 = 0;
function Start ()
{
for (var i : int = 0;i &amp;lt; Area; i++)
    {
      for (var j : int = 0;j &amp;lt; Area; j++)
      {
        Instantiate (prefab, Vector3(i * 1, 0, j*1), Quaternion.identity);
        rand = Random.Range(0, 1);
        rand2 = Random.Range(0, 3);
        if(rand == rand2)
        Instantiate (height, Vector3(i ,1 ,j ), Quaternion.identity);
      }
    }
 }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Вот более сложная Генерация:&lt;br /&gt;Скрипт JS:&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;private var _field: GameObject[,,]; // наш ландшафт (является трехмерным массивом)
private var _height: int[,]; // высота данного места ландшафта
private var _maxSize: int = 32; // максимальная ширина ландшафта
private var _maxH: int = 64; // максимальная высота ландшафта
private var _maxR: int = 16; // максимальный радиус сферы
private var _spheresCount: int = 16; // количество сфер
var _prefabCube: GameObject; // префаб куба

function Start ()
{
// Инициализация массивов
_field = new GameObject[_maxSize, _maxH, _maxSize];
_height = new int[_maxSize, _maxSize];

// Создание поля (высота равна 0)

var i: int;
var j: int;
for (i = 0; i&amp;lt;_maxSize; i++)
{
for (j = 0; j&amp;lt;_maxSize; j++)
{
_height[i,j] = 0;

var _pos: Vector3 = Vector3(i-_maxSize/2, _height[i,j], j-_maxSize/2);
_field[i,0,j] = Instantiate(_prefabCube, _pos, Quaternion.identity);
_field[i,0,j].transform.parent = transform;
_field[i,0,j].transform.name = &amp;quot;cube&amp;quot;;
}
}

// Изменение ландшафта по изученному алгоритму

for (i = 0; i&amp;lt;_spheresCount; i++)
{
_pos = Vector3(Random.Range(0, _maxSize), 0, Random.Range(0, _maxSize));
var _r: int = Random.Range(1, _maxR);

for (var _x: int = _pos.x-_r; _x&amp;lt;_pos.x+_r; _x++)
{
for (var _z: int = _pos.z-_r; _z&amp;lt;_pos.z+_r; _z++)
{
var _inc: int = Mathf.Pow(_r, 2)-(Mathf.Pow(_x-_pos.x, 2)+Mathf.Pow(_z-_pos.z, 2));
if (_inc &amp;gt; 0 &amp;amp;&amp;amp; _x&amp;gt;=0 &amp;amp;&amp;amp; _z&amp;gt;=0 &amp;amp;&amp;amp; _x&amp;lt;_maxSize &amp;amp;&amp;amp; _z&amp;lt;_maxSize)
{
_inc = Mathf.Round(Mathf.Sqrt(_inc));
_height[_x,_z] = _height[_x,_z]+_inc;
_field[_x,0,_z].transform.position.y = _height[_x,_z];
}
}
}
}

// Нормализация (я не использовал)

// Заполнение промежутков между соседними платформами
for (i = 1; i&amp;lt;_maxSize-1; i++)
{
for (j = 1; j&amp;lt;_maxSize-1; j++)
{
var _minH: int = _height[i,j];
_minH = Mathf.Min(_minH, _height[i-1, j-1]);
_minH = Mathf.Min(_minH, _height[i, j-1]);
_minH = Mathf.Min(_minH, _height[i+1, j-1]);
_minH = Mathf.Min(_minH, _height[i-1, j]);
_minH = Mathf.Min(_minH, _height[i+1, j]);
_minH = Mathf.Min(_minH, _height[i-1, j+1]);
_minH = Mathf.Min(_minH, _height[i, j+1]);
_minH = Mathf.Min(_minH, _height[i+1, j+1]);
for (_z = 1; _z &amp;lt;= _height[i,j]-_minH; _z++)
{
_pos = Vector3(i-_maxSize/2, _height[i,j]-_z, j-_maxSize/2);
_field[i,_z,j] = Instantiate(_prefabCube, _pos, Quaternion.identity);
_field[i,_z,j].transform.parent = transform;
_field[i,_z,j].transform.name = &amp;quot;cube&amp;quot;;
}
}
}
}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Теги: Генерация, Мир&lt;/p&gt;</description>
			<author>mybb@mybb.ru (Ohlopkoff1)</author>
			<pubDate>Mon, 13 Jan 2014 21:45:34 +0400</pubDate>
			<guid>https://lunity.hutt.live/viewtopic.php?pid=2#p2</guid>
		</item>
	</channel>
</rss>
