Sunday 6 September 2015

Unity 3d Free Radar system

Unity 3d Free Radar system

































DIRECT DOWNLOAD HERE















THIS IS BACKUP  IN TEXT FORM  TUTORIAL Unity3D Free Radar System

1. Create New C# and name it : RadarSystem


2. Copy & Past this text and save C# :
----------------------------------------­­­­­------------------------------------­-­-­-­-­-


/// <summary>
/// Radar System. detection  on minimap by Tags[]
/// </summary>
using UnityEngine;
using HWRcomponent;
using System.Collections;


namespace HWRcomponent
{
public enum Alignment
{
None,
LeftTop,
RightTop,
LeftBot,
RightBot ,
MiddleTop ,
MiddleBot
}

}
public class RadarSystem : MonoBehaviour
{

private Vector2 inposition;
public float Size = 400; //  minimap size
public float Distance = 100;// maximum distance of game objects
public float Transparency = 0.5f;// Texture Transparency
public Texture2D[] Navtexture;// textutes list
public string[] EnemyTag;// object tags list
public Texture2D NavCompass;// compass texture
public Texture2D CompassBackground;// background texture
public Vector2 PositionOffset = new Vector2 (0, 0);// minimap position offset
public float Scale = 1;// mini map scale ( Scale < 1 = zoom in , Scale > 1 = zoom out)
public Alignment PositionAlignment = Alignment.None;// position alignment
public bool MapRotation;
public GameObject Player;
public bool Show = true;
public Color ColorMult = Color.white;
void Start ()
{
}

void Update ()
{
if (!Player) {
Player = this.gameObject;
}
if (Scale <= 0) {
Scale = 100;
}
// define the position
switch (PositionAlignment) {
case Alignment.None:
inposition = PositionOffset;
break;
case Alignment.LeftTop:
inposition = Vector2.zero + PositionOffset;
break;
case Alignment.RightTop:
inposition = new Vector2 (Screen.width - Size, 0) + PositionOffset;
break;
case Alignment.LeftBot:
inposition = new Vector2 (0, Screen.height - Size) + PositionOffset;
break;
case Alignment.RightBot:
inposition = new Vector2 (Screen.width - Size, Screen.height - Size) + PositionOffset;
break;
case Alignment.MiddleTop:
inposition = new Vector2 ((Screen.width / 2) - (Size / 2), Size) + PositionOffset;
break;
case Alignment.MiddleBot:
inposition = new Vector2 ((Screen.width / 2) - (Size / 2), Screen.height - Size) + PositionOffset;
break;
}
}
// convert 3D position to 2D position
Vector2 ConvertToNavPosition (Vector3 pos)
{
Vector2 res = Vector2.zero;
if (Player) {
res.x = inposition.x + (((pos.x - Player.transform.position.x) + (Size * Scale) / 2f) / Scale);
res.y = inposition.y + ((-(pos.z - Player.transform.position.z) + (Size * Scale) / 2f) / Scale);
}
return res;
}

void DrawNav (GameObject[] enemylists, Texture2D navtexture)
{
if (Player) {
for (int i=0; i<enemylists.Length; i++) {
if (Vector3.Distance (Player.transform.position, enemylists [i].transform.position) <= (Distance * Scale)) {
Vector2 pos = ConvertToNavPosition (enemylists [i].transform.position);
if (Vector2.Distance (pos, (inposition + new Vector2 (Size / 2f, Size / 2f))) + (navtexture.width / 2) < (Size / 2f)) {
float navscale = Scale;
if (navscale < 1) {
navscale = 1;
}
GUI.DrawTexture (new Rect (pos.x - (navtexture.width / navscale) / 2, pos.y - (navtexture.height / navscale) / 2, navtexture.width / navscale, navtexture.height / navscale), navtexture);
}
}
}
}
}

float[] list;

void OnGUI ()
{
if (!Show)
return;
GUI.color = new Color (ColorMult.r, ColorMult.g, ColorMult.b, Transparency);
if (MapRotation) {
GUIUtility.RotateAroundPivot (-(this.transform.eulerAngles.y), inposition + new Vector2 (Size / 2f, Size / 2f)); 
}
for (int i=0; i<EnemyTag.Length; i++) {
DrawNav (GameObject.FindGameObjectsWithTag (EnemyTag [i]), Navtexture [i]);
}
if (CompassBackground)
GUI.DrawTexture (new Rect (inposition.x, inposition.y, Size, Size), CompassBackground);
GUIUtility.RotateAroundPivot ((this.transform.eulerAngles.y), inposition + new Vector2 (Size / 2f, Size / 2f)); 
if (NavCompass)
GUI.DrawTexture (new Rect (inposition.x + (Size / 2f) - (NavCompass.width / 2f), inposition.y + (Size / 2f) - (NavCompass.height / 2f), NavCompass.width, NavCompass.height), NavCompass);

}
}










 ----------------------------------------­­­­­------------------------------------­-­-­-­-­-

And Images BackUp Here .)




















































































10 comments:

  1. That's Frikkin Awesome Thank You!!!!!!!!!!!!
    You Are The Man! =)

    ReplyDelete
    Replies
    1. Unity 3D Radar System ~ Unity3D Warehouse >>>>> Download Now

      >>>>> Download Full

      Unity 3D Radar System ~ Unity3D Warehouse >>>>> Download LINK

      >>>>> Download Now

      Unity 3D Radar System ~ Unity3D Warehouse >>>>> Download Full

      >>>>> Download LINK 6Y

      Delete
  2. Thank you soooooooooooooooooooooooooo muuuuuuuuuuuuuuuch, you're the best:)

    ReplyDelete
  3. Hi,
    is this a free script?

    I would love to use it in a commercial game, but I saw that under:
    https://www.assetstore.unity3d.com/en/#!/content/8403
    an author named Hardworker Studio (Rachan N.) is selling an asset, that looks almost like these graphics and the pictures from the editor.

    The asset is Originally released: 29 April 2013.

    Could you help me?

    ReplyDelete
  4. Good afternoon! When I made the radar on your tutorial, everything works fine, no doubt. BUT, I have a dilemma, I do a radar for a space jar, and when I turn the ship or cant - the radar starts to walk, how can I fix it?

    ReplyDelete
  5. Oh very good, thank you so much for your help

    ReplyDelete
  6. Unity 3D Radar System ~ Unity3D Warehouse >>>>> Download Now

    >>>>> Download Full

    Unity 3D Radar System ~ Unity3D Warehouse >>>>> Download LINK

    >>>>> Download Now

    Unity 3D Radar System ~ Unity3D Warehouse >>>>> Download Full

    >>>>> Download LINK Uk

    ReplyDelete