当前位置:网站首页>Some common skills on unity inspector are generally used for editor extension or others
Some common skills on unity inspector are generally used for editor extension or others
2022-07-06 04:50:00 【charlsdm】
RequireComponent
RequireComponent For giving Object Add the necessary components , It can also be understood as replacing “Add Component” The operation of , It can effectively avoid errors caused by forgetting to add necessary components , It also applies to multiple Object Add scenes with the same components , There is no repetition .
in addition RequireComponent The code needs to be placed in front of the class
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(AudioSource))]
It should be noted that , When you want to remove through RequireComponent When adding components , You need to remove the script first , Otherwise, the following warning will be generated .
Range
Range Limit the value range of variables , But only in Inspector Window , in other words , Changing the value of a variable through code is not affected by Range Constrained
[Range(1, 5)]
public int Speed;
[Range(0,1)]
public float Time;
Space
Space send Inspector The spacing between fields in the window increases
public float Max;
public float Min;
[Space()]
public float Speed;
SerializeField
Generally speaking , Only public Will be displayed in Inspector Window , but SerializeField The access modifier can be ignored , send private Variables of can also be displayed
private bool NotInInspector;
[SerializeField] private bool InInspector;
HideInInspector
send public The field of is not displayed in Inspector Window
[HideInInspector]
public float Hide;
public float notHide;
Tooltip
by Inspcetor A text description is attached to the fields in the window
[Tooltip("Health value between 0 and 100.")]
public int Health = 100;
Header
to Inspector Field with title , Implement grouping
[Header(“Text”)]
public Text hp;
public Text mp;
public Text power;
public Text defense;
边栏推荐
- 你需要知道的 TCP 三次握手
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- Pagoda configuration mongodb
- 二叉树基本知识和例题
- newton interpolation
- 2021 robocom world robot developer competition - undergraduate group (semi-finals)
- Summary of three log knowledge points of MySQL
- What are the advantages of the industry private network over the public network? What specific requirements can be met?
- Dynamic programming (tree DP)
- Postman关联
猜你喜欢
[classic example] binary tree recursive structure classic topic collection @ binary tree
Sqlserver query results are not displayed in tabular form. How to modify them
yolov5 tensorrt加速
Introduction of several RS485 isolated communication schemes
图论的扩展
Application of Flody
[05-1, 05-02, 05-03] network protocol
麦斯克电子IPO被终止:曾拟募资8亿 河南资产是股东
[Chongqing Guangdong education] engineering fluid mechanics reference materials of southwestjiaotonguniversity
The IPO of mesk Electronics was terminated: Henan assets, which was once intended to raise 800 million yuan, was a shareholder
随机推荐
Dynamic programming (tree DP)
8. Static file
[lgr-109] Luogu may race II & windy round 6
Introduction of several RS485 isolated communication schemes
Postman manage test cases
SharedPreferences source code analysis
The implementation of the maize negotiable digital warehouse receipt standard will speed up the asset digitization process of the industry
程序员在互联网行业的地位 | 每日趣闻
[05-1, 05-02, 05-03] network protocol
Raspberry pie 3.5-inch white screen display connection
web工程导入了mysql驱动jar包却无法加载到驱动的问题
yolov5 tensorrt加速
Codeforces Round #804 (Div. 2)
Weng Kai C language third week 3.1 punch in
Application of Flody
Bill Gates posted his 18-year-old resume and expected an annual salary of $12000 48 years ago
ORM aggregate query and native database operation
Selection sort
ue5 小知识 FreezeRendering 查看视锥内渲染的物体
2021 RoboCom 世界机器人开发者大赛-本科组(复赛)