当前位置:网站首页>Unity skframework framework (XXIII), minimap small map tool
Unity skframework framework (XXIII), minimap small map tool
2022-07-05 09:24:00 【CoderZ1010】
Catalog
brief introduction
MiniMap It can help us quickly realize the function of small map , The tool has been uploaded to my development framework SKFramework Medium Package Manager In the development kit manager , As shown in the figure , Click on the bottom right corner Install Button to download and install .
SKFramework Framework open source address :
https://github.com/136512892/SKFramework
Realization principle
1. Take... In the scene z The positive direction of the axis is up 、 With x The positive direction of the axis is right ;
2. Take the lower left corner and the upper right corner of the scene as two benchmarks , Record as leftBottom、rightTop;
3. Put the... Of the target object in the scene Transform Record as target3d;
4. Will represent the target object in the interface Icon Icon's RectTransform Record as target2d;
5. Put the small map RectTransform Component record is mapRt;
6. Divide the length of the mini map by the length of the scene to get the proportion in the horizontal direction ;
(mapRt.rect.width / (rightTop.position.x - leftBottom.position.x))
7. Divide the width of the mini map by the width of the scene to get the proportion in the vertical direction ;
(mapRt.rect.height / (rightTop.position.z - leftBottom.position.z))
8. Calculate the length and width of the three-dimensional target object from the base point of the lower left corner , Record as horizontal、vertical;
(horizontal = target3d.position.x - leftBottom.position.x)
(vertical = target3d.position.z - leftBottom.position.z)
9. Calculate in the small map Icon The length and width of the icon from the lower left corner , Record as x、y;
(x = horizontal * Proportion in horizontal direction )
(y = vertical * Scale in the vertical direction )
10.Icon Icon sets the anchor to the lower left corner , Set its position .
(target2d.anchoredPosition = new Vector(x, y))
Instructions
isEnableRot:Icon Whether the icon rotates with the rotation of the 3D target
isEnableRotLerp: Whether to use interpolation operation when calculating rotation value
rotationLerpTime: The time required to interpolate to the target angle
边栏推荐
- My life
- Priority queue (heap)
- scipy.misc.imread()
- 阿里十年测试带你走进APP测试的世界
- [ManageEngine] how to make good use of the report function of OpManager
- Can't find the activitymainbinding class? The pit I stepped on when I just learned databinding
- Introduction Guide to stereo vision (2): key matrix (essential matrix, basic matrix, homography matrix)
- Hosting environment API
- C language - input array two-dimensional array a from the keyboard, and put 3 in a × 5. The elements in the third column of the matrix are moved to the left to the 0 column, and the element rows in ea
- An article takes you into the world of cookies, sessions, and tokens
猜你喜欢
Applet global style configuration window
项目实战 | Excel导出功能
Editor use of VI and VIM
Information and entropy, all you want to know is here
Hosting environment API
[code practice] [stereo matching series] Classic ad census: (6) multi step parallax optimization
嗨 FUN 一夏,与 StarRocks 一起玩转 SQL Planner!
Priority queue (heap)
Svgo v3.9.0+
Can't find the activitymainbinding class? The pit I stepped on when I just learned databinding
随机推荐
OpenGL - Coordinate Systems
Introduction Guide to stereo vision (6): level constraints and polar correction of fusiello method
c语言指针深入理解
Talking about label smoothing technology
Kotlin introductory notes (I) kotlin variables and non variables
C # image difference comparison: image subtraction (pointer method, high speed)
2310. The number of bits is the sum of integers of K
Solution to the problems of the 17th Zhejiang University City College Program Design Competition (synchronized competition)
np.allclose
VS Code问题:长行的长度可通过 “editor.maxTokenizationLineLength“ 进行配置
【组队 PK 赛】本周任务已开启 | 答题挑战,夯实商品详情知识
Generate confrontation network
[Yugong series] go teaching course 003-ide installation and basic use in July 2022
Progressive JPEG pictures and related
Alibaba's ten-year test brings you into the world of APP testing
LeetCode 503. 下一个更大元素 II
Applet (subcontracting)
高性能Spark_transformation性能
一次 Keepalived 高可用的事故,让我重学了一遍它
Understanding rotation matrix R from the perspective of base transformation