当前位置:网站首页>Minimap plug-in
Minimap plug-in
2022-07-03 08:06:00 【Luckyᕙ(⇀‸↼‵‵)ᕗ】
One 、 First, we import the plug-in package Minimap.unitypackage
1、 Drag the mini map preset to the scene

2、 There will be two mistakes on the right

3、 On the top Layer Choose from Add Layer:
4、 In the presence of Layer Add a window named “mapsystem” Of Layer, The name must be “mapsystem”

This is one less error report
5、 The second error is that the target cannot be empty , So drag players here

6、 This mark can be entrusted to the player or NPC The following is a sub object

Two 、 Their own use NGUI Make a small map
1、 Import resources

2、 We add a camera to the scene called minimapCamera, Put the above Audio Listener Remove the components , Adjust the camera position , Place it directly above the character ,X rotate 90 degree , Pictured

The camera can be replaced with rectangular port or conical port

3、 Create a new render map Render Texture We call it minimapTexture,Texture The size there is adjusted to 512*512 Of , As minimapCamera Of Target Texture


4、 Choose Mini The camera , Put the rendering map on
5、 Create a shader material,Assets->Create->Material
6、 Then in the shader Shader Find the one you built there shader, stay Transparent below . At this time, the interface will appear Base(RGB) and Culling Mask,Base(RGB) Drag your previous rendering map up ,Culling Mask Drag the white round picture up , Here's the picture :


7、 Use... In the upper right corner of the interface NGUI Map building ( First create a picture and put it in the upper right corner )

8、 Build another one Texture Used to receive the previous material display map

9、 Drag the previously made materials and maps here

10、 Create two buttons to zoom in and out

11、 to minimap Add a script Minimap, Add the relevant functions of event control small map to the two keys
public class Minimap : MonoBehaviour
{
private Camera minimapCamera;
private Transform player;
private Vector3 offsetPosition;
void Start ()
{
minimapCamera = GameObject.FindGameObjectWithTag(Tags.MINIMAP_CAMERA)
.GetComponent<Camera>()
player = GameObject.FindGameObjectWithTag(Tags.PLAYER).transform;
offsetPosition = minimapCamera.transform.position - player.position;
}
void Update()
{
minimapCamera.transform.position = offsetPosition + player.position;
}
public void ZoomInButtonClick()
{
minimapCamera.fieldOfView += 10;
}
public void ZoomOutButtonClick()
{
minimapCamera.fieldOfView -= 10;
}
}
By changing minimapCamera Of fieldOfView To control the zoom of the field of view of the small map , The camera follows the character by setting the distance from the character to remain unchanged
12、 In a small map, like some Npc It is usually displayed as an icon , How to achieve this requirement ?
We can do it in npc Or create a new one above the player model Quad, And give the corresponding icon map , And then all Npc Create a layer NPC, All icons create a layer NpcIcon, Render on the main camera NPC layer , Render on the mini map camera NpcIcon Layer can be
At this time, there will be a problem , Marks can also be seen in the scene , At this time, you just need to click the main camera and choose to remove the mask NPC And the player's tag layer is not selected

边栏推荐
- PHP wechat red packet grabbing algorithm
- PHP common sorting algorithm
- About Wireshark's unsuccessful installation of npcap
- Differences between tp3.2 and tp5.0
- 什么是数据类型?数据类型有什么用?
- vcs import src < ros2. Repos failed
- JS common basic case sorting (continuous update)
- Clip Related Script
- 【cocos creator】点击按钮切换界面
- [untitled]
猜你喜欢

Oracle queries grouped by time

璞华PLM为全场景产品生命周期管理赋能,助力产品主线的企业数字化转型

What is a data type? What is the use of data types?

How to establish rectangular coordinate system in space
![[set theory] order relation (the relation between elements of partial order set | comparable | strictly less than | covering | Haas diagram)](/img/df/a034032e203e7935dafaf8a71cb6c8.jpg)
[set theory] order relation (the relation between elements of partial order set | comparable | strictly less than | covering | Haas diagram)

什么是数据类型?数据类型有什么用?

Worldview satellite remote sensing image data / meter resolution remote sensing image

一个实习生的CnosDB之旅

数据库应用技术课程设计之商城管理系统

About the problem that the editor and the white screen of the login interface cannot be found after the location of unityhub is changed
随机推荐
Unity dotween sequence animation replay problem.
The difference between hdmi2.1 and hdmi2.0 and the conversion of PD signals.
Viz artist advanced script video tutorial -- stringmap use and vertex operation
P1896 [scoi2005] non aggression (shape pressure DP)
Product creation and commercial realization of chat robot (according to La Ma Bang - Dr. Wang Jingjing - speech)
P2704 [NOI2001] 炮兵阵地(状压dp)
Use filechannel to copy files
An article for you to understand - Manchester code
[set theory] order relation (hastu example | divisive relation hastu | inclusive relation hastu | refinement relation hastu)
How to establish rectangular coordinate system in space
Docker installs MySQL and successfully uses Navicat connection
jsutlis
Oracle insert single quotation mark
数据的存储
[USACO12MAR]Cows in a Skyscraper G(状态压缩dp)
oracle中的 (+)是什么意思
idea取消引用顯示效果
Unity performance optimization
使用 FileChannel 进行文件的复制拷贝
[untitled]