当前位置:网站首页>Quelques conseils communs sur l'inspecteur de l'unit é, généralement pour les extensions d'éditeur ou d'autres
Quelques conseils communs sur l'inspecteur de l'unit é, généralement pour les extensions d'éditeur ou d'autres
2022-07-06 04:49:00 【Charlsdm】
RequireComponent
RequireComponentPourObjectAjouter les composants nécessaires,Il peut également être interprété comme remplaçant“Add Component”Fonctionnement,Peut efficacement éviter les erreurs causées par l'oubli d'ajouter les composants nécessaires,Cela s'applique également auxObjectAjouter un scénario avec le même composant,L'opération répétée a été omise.
En plusRequireComponentLe code doit précéder la classe
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(AudioSource))]
Il est important de noter que,Quand vous voulez supprimer passRequireComponentLors de l'ajout d'un composant,Vous devez d'abord supprimer le script,Sinon, l'avertissement suivant est généré.
Range
RangeDéfinir une plage de valeurs pour les variables,Mais seulement dansInspectorDans la fenêtre,C'est - à - dire,Changer la valeur d'une variable par Code n'est pas acceptableRangeConstrained
[Range(1, 5)]
public int Speed;
[Range(0,1)]
public float Time;
Space
SpaceFaireInspectorAugmentation de l'espacement entre les champs dans la fenêtre
public float Max;
public float Min;
[Space()]
public float Speed;
SerializeField
En général,Seulementpublic Les variables de sont affichées dans InspectorDans la fenêtre,Mais...SerializeField Les modificateurs d'accès peuvent être ignorés ,Faireprivate Les variables peuvent également afficher
private bool NotInInspector;
[SerializeField] private bool InInspector;
HideInInspector
Fairepublic Les champs de n'apparaissent pas dans InspectorDans la fenêtre
[HideInInspector]
public float Hide;
public float notHide;
Tooltip
PourInspcetor Les champs de la fenêtre sont accompagnés d'une description textuelle
[Tooltip("Health value between 0 and 100.")]
public int Health = 100;
Header
Voilà.Inspector Champ avec Titre ,Groupe de mise en œuvre
[Header(“Text”)]
public Text hp;
public Text mp;
public Text power;
public Text defense;
边栏推荐
- Codeforces Round #804 (Div. 2)
- Database - MySQL storage engine (deadlock)
- 11. Intranet penetration and automatic refresh
- Finance online homework
- win10电脑系统里的视频不显示缩略图
- [classic example] binary tree recursive structure classic topic collection @ binary tree
- Upload nestjs configuration files, configure the use of middleware and pipelines
- Delete subsequence < daily question >
- Unity screen coordinates ugui coordinates world coordinates conversion between three coordinate systems
- Summary of three log knowledge points of MySQL
猜你喜欢

Use sentinel to interface locally

Database - MySQL storage engine (deadlock)

Postman manage test cases

Digital children < daily question> (Digital DP)

DMA use of stm32
![[Yu Yue education] reference materials of complex variable function and integral transformation of Northwestern Polytechnic University](/img/22/ead74bc121a64910ef6ef374cd029b.png)
[Yu Yue education] reference materials of complex variable function and integral transformation of Northwestern Polytechnic University

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

Etcd database source code analysis -- etcdserver bootstrap initialization storage

View workflow

11. Intranet penetration and automatic refresh
随机推荐
Excellent PM must experience these three levels of transformation!
[Chongqing Guangdong education] Suzhou University English film and Television Appreciation reference materials
Postman断言
Complete list of common functions of turtle module
Database - MySQL storage engine (deadlock)
Orm-f & Q object
8. Static file
从0到1建设智能灰度数据体系:以vivo游戏中心为例
Leetcode 186 Flip the word II in the string (2022.07.05)
Postman pre script - global variables and environment variables
Quatre méthodes de redis pour dépanner les grandes clés sont nécessaires pour optimiser
The web project imported the MySQL driver jar package but failed to load it into the driver
Pagoda configuration mongodb
RTP gb28181 document testing tool
Etcd database source code analysis -- etcdserver bootstrap initialization storage
DMA use of stm32
Bubble sort
SQL injection vulnerability (MSSQL injection)
Weng Kai C language third week 3.1 punch in
程序员在互联网行业的地位 | 每日趣闻