Unity: 4.5.1 njg minimap: 1.5
Reference link: http://blog.csdn.net/wuming22222/article/details/37526659, Author: csdn sheldoncooper
There are many Download Links for njg minimap, but it seems that there are very few reference materials for the tutorial. There is a simple introduction on the official website, but it is only version 1.2, and it is stored on Google doc, you can download it by yourself. Here the download link of csdn: http://download.csdn.net/detail/linw1225/7832395
1. After downloading the plug-in, import it to unity. You can see the ninjutsugames folder after the import. All the plug-in content is in this folder, double-click the ngui version package under the ninjutsugames/njg minimap directory to generate an ngui version Folder:
2. You can view examples in ngui version/examples/scene2. You can only view these examples. The documents provided on the official website and the information on the Internet are poor:
You can open the example scenario example-bigterain to check the effect, but there seems to be a bug. When you view the world map, an error is displayed. I don't know why, as shown in the following figure. You can see the red arrow in the figure:
3. After reading the official example, we can create a scenario and try it by ourselves. Here I will not set up my own scenario, but directly use the scenario created by njg minimap:
Create a new scenario named scene9. Find the scene. Prefab in the ninjutsugames \ njg minimap \ examplesassets \ prefabs directory and drag it directly to the hierarchy column. The running result is as follows:
In this case, some objects may encounter the following errors:
This is because the script for the corresponding small map has been bound to the preset, but now we have not added the ngui content for the relevant small map. There are two solutions: (1) directly Delete this script; (2) you just need to add relevant content later
Delete the script of all objects in scene;
4. The next step is to add a small map. The small map is created using ngui. Therefore, you must first create a 2D UI: ngui --> Create --> 2D UI:
Set njg minimap under ninjutsugames \ njg minimap \ ngui version \ prefabs. drag the prefab file to the UI root and click camera under UI root. You can see the thumbnail of the map in the lower right corner of scene:
At this time, click run to see that the small map has already appeared, as shown below:
However, there is no logo in a small map. We need to create the main character object for the small map, as well as some enemy monsters, such as the NPC;
5. Locate the njgmapitem script in the ninjutsugames \ njg minimap \ common \ scripts \ core directory. CS, added to the object to be identified. In this scenario, we use _ player in scene as an example to add the script to the _ player component, and then select njgmap item (SCRIPT) in the market type option, here we select me, you can see the identifier of the _ player object in the MAP:
6. You can also select the custom icon and select Edit njg minimap in the njgmap item component of _ player for editing:
For example:
ALTAS selects the gallery where the custom icon is located;
Click Add new to add a new market type;
Set the current marker name for marker type;
Icon Sprite is to select the corresponding icon;
7. Modify the corresponding marker type name in step 5. The effect is as follows:
8. You can also add the fog effect to the map:
Select njg minimap under UI root, find the fow items in the njgmap component, and check the enabled items:
At this time, the small map has been covered by fog, and you also need to set the object visibility. Select the reveal fow option in njgmap item in _ player to adjust the visible distance. If the visible distance is 0, all objects are visible by default:
9. The final result is as follows:
Code:
Https://github.com/vitah-lin/Unity
Summary:
1. The evaluation of this plug-in is very high on the internet outside China. You can also use this plug-in to easily implement many functions. However, the disadvantage is that there are few documents and tutorials, here is just a basic function, you can explore it on your own;
2. The scenario here comes with the plug-in. I have not tested it in my own deployment scenario. I don't know if it works. If there is any problem, please leave a message or email linw1225 # 163.com( # Replace @) ~~ Thank you.
Simple use of the Unity small map creation plug-in njg minimap