当前位置:网站首页>[100 unity stepping pit knowledge points] | draw cube dotted line and sphere dotted line (gizmos auxiliary wireframe) in the editor
[100 unity stepping pit knowledge points] | draw cube dotted line and sphere dotted line (gizmos auxiliary wireframe) in the editor
2022-06-21 12:18:00 【Hua Weiyun】

Unity Little science popularization
Old rules , Let me introduce you Unity A little knowledge of popular science :
- Unity yes real time 3D Interactive content creation and operation platform .
- Include Game development 、 The fine arts 、 Architecture 、 Automobile design 、 Movies All creators including , With the help of Unity Turn ideas into reality .
- Unity The platform provides a complete set of software solutions , Can be used to create 、 Operate and realize any real-time interactive 2D and 3D Content , Support platforms include mobile phone 、 The tablet 、PC、 Game consoles 、 Augmented reality and Virtual reality device .
- You can also simply put Unity Understood as a The game engine , It can be used for professional production game !
Unity Step on the pit to learn a little knowledge
Draw a cube dashed line in the editor 、 Sphere dotted line (Gizmos Auxiliary wireframe )
Use Gizmos Class allows us to Unity An auxiliary wireframe is implemented in , Here are some common wireframes .
added API You can come The official manual is about Gizmos see
Use Gizmos Drawing wireframe is used in the following two functions :
private void OnDrawGizmos(){ Debug.Log(" Keep calling " );}private void OnDrawGizmosSelected(){ Debug.Log("selected, Only when the object is selected, it is called " );}You can also use Gizmos.color Color change .
Be careful : Under normal circumstances, only in Scene See wireframe in , stay Game To open... In the view Gizmos Before you can see the wireframe 
The dashed boxes of cube and sphere are as follows :
private void OnDrawGizmos() { Gizmos.color = Color.green;// Change the color of the wireframe Gizmos.DrawWireCube(transform.position, new Vector3(3, 3, 3));// Cube dashed box Gizmos.DrawWireSphere(transform.position, 5f);// Sphere dashed box } The cube and sphere wireframes are as follows :
private void OnDrawGizmos() { Gizmos.color = Color.green;// Change the color of the wireframe Gizmos.DrawCube(transform.position, new Vector3(3, 3, 3));// Cube wireframe Gizmos.DrawSphere(transform.position, 5f);// Sphere wireframe }
边栏推荐
猜你喜欢

Hands on data analysis data reconstruction

i. MX - rt1052 pulse width modulation (PWM)

External-Attention-tensorflow(更新中)

Vs code + GCC environment compilation for STM32 development

Ansible 配置首次ssh免认证的操作说明

简单工厂VS工厂方法&手写自动化工厂——系统学习六

搭建zabbix监控及邮件报警

CPU、MPU、MCU、SoC、MCM介绍

RPC (remote procedure call protocol)
![[untitled]](/img/97/7a3dac6e07318613090722ec620e32.png)
[untitled]
随机推荐
STM32開發之 VS Code + gcc環境編譯
2. 引用
一文搞懂 Flink OperatorChain 对象重用
STM32 notes swj (jtag-dp and sw-dp)
Redis maximum memory elimination strategy
Inheritance and override of methods
WPF 使用 MAUI 的自绘制逻辑
STM32开发之 VS Code + GDB下载调试
6-Zabbix监控自动发现第三方中间件内存及CPU使用情况
为什么世界上只有13个根域名服务器
Compilation de l'environnement vs Code + GCC développé par stm32
20N10-ASEMI中低压MOS管20N10
理解RESTful架构
How does Huawei build a project centered project management system from 0 to 1?
Understand UML class diagram and sequence diagram
STL basic container test
HMS core machine learning service ID card identification function to achieve efficient information entry
Nanjing University static program analyses -- intermediate representation learning notes
MySQL-DML
站在数字化风口,工装企业如何“飞起来”