Thank you for purchasing UGUI MiniMap. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!
Introduction
Required:
- Unity 5.0++
- UGUI MiniMap 1.8++
Introduction:
UGUI MiniMap is a complete MiniMap / WorldMap solution for Unity uGUI. You can easily create any type of
minimap you want for any genre of game, like: race, fps, rpg games etc.
Features:
-UGUI Support. - Compass Bar. - Border Maps Icons. - Circle Border icons. - 3D and 2D Mode. - Static or Dynamic rotation map. - Hit / Damage Effect. - World map and Mini map - Panel info. - RealTime and Picture Render Mode. - Support custom map masks. - Create Waypoints / Icons easy in runtime. - Panning Tweening. - Zoom In and Out. - Easy to use (Drag and Drop). - Customize icon color, size, sprite etc. - Animated Icons. - Zoom Levels. - Buttons items. - Automatic bounds calculation. - Clean code - C#. - Well commented.
Get Started
Get Started:
Import UGUI MiniMap into your project.
In the level / scene where you want to put the minimap, drag the prefab of minimap Located in UGUI
MiniMap -> Content -> Prefabs -> Select MiniMap2D or MiniMap3D into scene.
Assign the target of MiniMap, usually the player or the object controlled by the player in:
MiniMap -> bl_MiniMap > Target.
Add the layer "MiniMap" in the LayerMaskList and be sure that select it in the 'MiniMapLayer' on MiniMap (in scene) -> bl_MiniMap ->
When we want to add a icon UI to display on the minimap that references an object.
Add bl_MiniMapItem.cs script the object of the scene that we want to show in the minimap.
Fill the variables required by following these instructions:
GraphicPrefab:The UI prefabs which is instantiated to display in the minimap, it should contain a component Image in the root of prefab.
Target: the object which will follow the UI, if the same as the one containing the component may leave empty.
OffSet:edit the posi on of the target.
DeathIcon:When we call to destroy the icon,this rts change the icon to a icon “death reference”,then destroy in certain time.
isInteractable: is the item work as a button.
Info Item: when the items is the bu on type, click on the Icon, it will show this text.
OffScreen:can the icon displayed on the edges.
RenderDelay: Time before render/show item in minimap after instance
Create Icon in runtime
For create a new item in scene runtime:
- From a script in scene, just create a new 'bl_MMItemInfo' with info of new item and send to bl_MiniMap to create,like this:
//function called for create new item
void CreateItem()
{
//position where instantiate item, you can use a reference position of scene
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray,out hit))
{
Debug.DrawLine(ray.origin, hit.point,Color.red);
Debug.Log(hit.point);
//Send info to bl_MiniMap for create item / icon
bl_MMItemInfo info = new bl_MMItemInfo(hit.point);
//If new item is not static (need folow a target) can create like this:
// bl_MMItemInfo info = new bl_MMItemInfo(TargetToFollow);//where TargetToFollow is a transform reference
//you have more options for customize new items,like this
info.Size = 15;
info.Color = new Color(1,0,0,1);
//see full options in bl_MMItemInfo.cs
//Send information to bl_MiniMap
MiniMap.CreateNewItem(info);//Where MiniMap is a reference of bl_MiniMap.cs
}
Change WordMap Position
Order to change the Word Map position, you need follow this steps:
Copy the default position of minimap root in the context menu of rectransform:
Change the position where you want see the WordMap (in inspector scene)
When you have it, go to bl_Minimap in the section "Map Rect" and click in the button 'Get Word Rect'
Now go again to the context menu of rectransform component (of MiniMap Root) and select 'Paste Component Values'
Ready!.
Show / Hide Icon
If you want hide / show again a icon in the minimap, you can do like this:
Firts, you need a reference of bl_MiniMapItem script of icon / item that you want hide / show, eg:
public bl_MiniMapItem MMIcon;
Now, you only need call:
For Show:
MMIcon.ShowItem();
For Hide:
MMIcon.HideItem();
Destroy Icon
Order to destroy a icon you can do like this:
If you want hide / show again a icon in the minimap, you can do like this:
Firts, you need a reference of bl_MiniMapItem script of icon / item that you want hide / show, eg:
public bl_MiniMapItem MMIcon;
Now, you only need call:
MMIcon.DestroyItem(bool inmediate);
bool inmediate: You want destroy the icon inmediate or wait the setup time before destroy it.
Render Mode
UGUI MiniMap It has two types of mini-rendering: RealTime and Picture Mode.
Real Time:
- This mode is more realistic and better resolution also objects to render the map in real time, but even greater cost performance, it is not recommended to use this on mobile platforms.
Picture Mode:
- This mode it much more customizable and very well optimized, uses an image as map reference, this means that only use 1 DrawCall to render the map (excluding icons) is recommended for mobile platforms.
We also recommend you use this when you need to customize the map image, you just need to take a screenshot of the map (below tutorial on how to do) and then you can manipulate this capture as you wish for create minimaps like this:
Picture Mode
Order to use MiniMap in Picture mode, you can do like this:
Firts, in bl_MiniMap select the field 'Type' in 'Picture'
Now go to the section "Picture Mode Settings".
in MapTexture field add the map screenshot (see the tutorial how take an).
if the field "Reference Mat" is empty, drag the material in folder: Assets\UGUIMiniMap\Content\Art\SnapShots\Materials/ReferenceMiniMap
if the field "Map Plane" is empty drag the prefab in the folder:Assets\UGUIMiniMap\Content\Prefabs\Util/MiniMapPlane
in the "World Space" drag the Rectransform called "WorldSpace" for default is located as child of MiniMap Canvas.
Select the Rectransform "WorldSpace" with tool RectTool:
Now re-size this rectTransfom with respect to the map boundaries:
Other field are customizables.
Ready!.
Take Screeshots
- If you are using Picture mode, you will need a image of map for render, we include a easy solution for this.
- Go to UGUIMiniMap -> Content -> Prefabs -> Util -> SnapShotCamera.
- Drag this prefab to the scene / map.
- Position the camera so that it covers the entire map and that this as central as possible as seen in this picture:
- Now you can take the snapShot, in the context menu of:
- Now your screenshot will be in Assets\UGUIMiniMap\Content\Art
Static Map
Order to use MiniMap in static / world mode,for render the whole world and not follow the player you can do like this:
You can use the MiniMap prefab "2D Static" that have all settings for static mode.
Go to the bl_MiniMap of scene now in the variable "MapType" select "World" mode.
Now you need setup the default render size in bl_MiniMap go to the variable "Default Height" play with this and you will see the MiniMap will render more or minus put as your taste
Also will requiered that set the variale "RotationAlwaysInFront" as false for icons rotate depent of target.
Done, these are the basic requerimients for use this map mode.
Icon Area
Order to show a circle area for a item / icon in the minimap like this:
follow these steps:
In the item/Icon (bl_MiniMapItem script) that you want show the circle area setup these variables:
-ShowCircleArea -> set this as true for show the circle area.
-CircleAreaRadius -> The size of area, you can play with it for the size as you want.
-CircleAreaColor -> The color of UI circle.
Maybe you need setup the circle in runtime by script, for this you can use:
for show the area call:
to the bl_MiniMapItem -> public void SetCircleArea(float radius, Color AreaColor)
where radius is the size and AreaColor the color of UI. you can use this for update the size or color too.
for hide the area call:
to the bl_MiniMapItem -> public void HideCircleArea()
Take Screeshots
- If you are using Picture mode, you will need a image of map for render, we include a easy solution for this.
- Go to UGUIMiniMap -> Content -> Prefabs -> Util -> SnapShotCamera.
- Drag this prefab to the scene / map.
- Position the camera so that it covers the entire map and that this as central as possible as seen in this picture:
- Now you can take the snapShot, in the context menu of:
- Now your screenshot will be in Assets\UGUIMiniMap\Content\Art
Contact
Any problem or question about UGUI MiniMap feel free to contact.