当前位置:网站首页>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
边栏推荐
- Kotlin introductory notes (VIII) collection and traversal
- C # image difference comparison: image subtraction (pointer method, high speed)
- Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
- What is a firewall? Explanation of basic knowledge of firewall
- Kotlin introductory notes (V) classes and objects, inheritance, constructors
- Introduction Guide to stereo vision (2): key matrix (essential matrix, basic matrix, homography matrix)
- 520 diamond Championship 7-4 7-7 solution
- Wxss template syntax
- Return of missing persons
- 【阅读笔记】图对比学习 GNN+CL
猜你喜欢
22-07-04 Xi'an Shanghao housing project experience summary (01)
LeetCode 503. 下一个更大元素 II
生成对抗网络
Kotlin introductory notes (V) classes and objects, inheritance, constructors
Creation and reference of applet
nodejs_ 01_ fs. readFile
Introduction Guide to stereo vision (7): stereo matching
nodejs_ fs. writeFile
Composition of applet code
An article takes you into the world of cookies, sessions, and tokens
随机推荐
Rebuild my 3D world [open source] [serialization-3] [comparison between colmap and openmvg]
STM32简易多级菜单(数组查表法)
nodejs_ fs. writeFile
np.allclose
Hi Fun Summer, play SQL planner with starrocks!
2309. 兼具大小写的最好英文字母
阿里十年测试带你走进APP测试的世界
Kotlin introductory notes (I) kotlin variables and non variables
牛顿迭代法(解非线性方程)
2020 "Lenovo Cup" National College programming online Invitational Competition and the third Shanghai University of technology programming competition
Ministry of transport and Ministry of Education: widely carry out water traffic safety publicity and drowning prevention safety reminders
Greendao reported an error in qigsaw, could not init daoconfig
Node collaboration and publishing
顶会论文看图对比学习(GNN+CL)研究趋势
2011-11-21 training record personal training (III)
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
Introduction Guide to stereo vision (4): DLT direct linear transformation of camera calibration [recommended collection]
【PyTorch Bug】RuntimeError: Boolean value of Tensor with more than one value is ambiguous
高性能Spark_transformation性能
Codeforces round 684 (Div. 2) e - green shopping (line segment tree)