当前位置:网站首页>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
边栏推荐
- A detailed explanation of the general process and the latest research trends of map comparative learning (gnn+cl)
- 2311. 小于等于 K 的最长二进制子序列
- Attention is all you need
- Talking about the difference between unittest and pytest
- Information and entropy, all you want to know is here
- Codeforces Round #648 (Div. 2) E.Maximum Subsequence Value
- [technical school] spatial accuracy of binocular stereo vision system: accurate quantitative analysis
- Hosting environment API
- 【PyTorch Bug】RuntimeError: Boolean value of Tensor with more than one value is ambiguous
- 什么是防火墙?防火墙基础知识讲解
猜你喜欢
Newton iterative method (solving nonlinear equations)
VS Code问题:长行的长度可通过 “editor.maxTokenizationLineLength“ 进行配置
OpenGL - Lighting
优先级队列(堆)
C语言-从键盘输入数组二维数组a,将a中3×5矩阵中第3列的元素左移到第0列,第3列以后的每列元素行依次左移,原来左边的各列依次绕到右边
Applet data attribute method
Information and entropy, all you want to know is here
nodejs_ 01_ fs. readFile
Android 隐私沙盒开发者预览版 3: 隐私安全和个性化体验全都要
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
随机推荐
高性能Spark_transformation性能
L'information et l'entropie, tout ce que vous voulez savoir est ici.
Nips2021 | new SOTA for node classification beyond graphcl, gnn+ comparative learning
Talking about label smoothing technology
AUTOSAR from getting started to mastering 100 lectures (103) -dbc file format and creation details
Applet network data request
Global configuration tabbar
Causes and appropriate analysis of possible errors in seq2seq code of "hands on learning in depth"
Jenkins Pipeline 方法(函数)定义及调用
Applet global style configuration window
2310. The number of bits is the sum of integers of K
3D reconstruction open source code summary [keep updated]
Rebuild my 3D world [open source] [serialization-3] [comparison between colmap and openmvg]
Applet data attribute method
Creation and reference of applet
[beauty of algebra] solution method of linear equations ax=0
Jenkins pipeline method (function) definition and call
22-07-04 Xi'an Shanghao housing project experience summary (01)
Kotlin introductory notes (V) classes and objects, inheritance, constructors
Analysis of eventbus source code