当前位置:网站首页>GameObject class and transform class of unity
GameObject class and transform class of unity
2022-07-05 04:52:00 【yaohuiyaoo】
- 1.GameObject: A class type , All game objects are objects of this type
2.gameObject: An object , It refers to the game object attached to the script An instance of the current GameObject
3.Transfrom: Is a class , It is used to describe the size, position, rotation and other information of the object
4.Transfrom yes Transfrom The object of , Attach to every object
It is also a component of the current game object ( Every object has this component ). Components of the current GameObject
5.gameObject.transfrom=this.transfrom=transfrom Get the component of the current game object
6.Transfrom.gameObject=gameObject=this.gameObject obtain transfrom Of gameObject
7.GameObject.Find from Scene( head ) Start looking for , according to GameObject Find the name of . Allow to use ”/” Search through the hierarchy , The object must be active active ( By default, it is active )
8.GameObject.FindWithTag according to tag( label ) Find a gameObject
9.GameObject.FindGameObjectsWithTag according to Tag Batch Search GameObject
10.GameObject.FindObjectOfType< Components >(): Find the object that owns the component according to the component , If you find an object of a component , Will find the lowest object that owns the component , When looking for multiple objects with this component , The lowest object with this component will be put into the array first
11.Transfrom:
1. You can find hidden objects
Hidden objects can include any parent node of the lookup path hidden , Child nodes can still (active=flase)
2. Support path lookup
3. The premise of finding hidden objects is transfrom The underlying node must be visible, that is active=true
11.gameObject:
1.gameObject.name Object name
2.gameObject.tag Object label
3.gameObject.layer: Layer of object
4.gameObject.SetActive(flase); Game object deactivation
5.gameObject.GetComponent(typeof(T)) , gameObject.GetComponent() Get the components in the game ( Use the output , Can be judged , If there is no such component in the game object, the output is null)
12. Use object =GetComponent< Components >() You can add components to objects ( Custom components ( Can be a class ) And its own components )
13. The game object .AddComponent< Components >() Add the component
14. Components isTrigger The function is to set whether the collision body is a trigger
15.Vector3(x,y,z): This method is used to set the orientation 1`
16.Time.deltaTime The number of seconds taken from running to the last second of completion
17.Invoke( Method , Number of seconds ): How many seconds will it take to call the method
18.Destory( The game object , Time ): How many seconds to destroy the game object
19.Rotate: Method of rotating components
边栏推荐
- JVM 原理和流程简介
- [groovy] closure (closure call | closure default parameter it | code example)
- Data security -- 14 -- Analysis of privacy protection governance
- 2020-10-27
- The 22nd Spring Festival Gala, an immersive stage for the yuan universe to shine into reality
- 54. 螺旋矩阵 & 59. 螺旋矩阵 II ●●
- Emlog blog theme template source code simple good-looking responsive
- 【acwing】528. cheese
- flutter 对象和列表
- SQLServer 存储过程传递数组参数
猜你喜欢

54. 螺旋矩阵 & 59. 螺旋矩阵 II ●●

Advanced length of redis -- deletion strategy, master-slave replication, sentinel mode

The 22nd Spring Festival Gala, an immersive stage for the yuan universe to shine into reality

3dsmax snaps to frozen objects

AutoCAD - lengthening

Is $20billion a little less? Cisco is interested in Splunk?
![[AI bulletin 20220211] the hard core up owner has built a lidar and detailed AI accelerator](/img/cc/06580ce7b553182968d273841a78b4.jpg)
[AI bulletin 20220211] the hard core up owner has built a lidar and detailed AI accelerator

AutoCAD -- dimension break

Number theoretic function and its summation to be updated

Special information | finance, accounting, audit - 22.1.23
随机推荐
windows下Redis-cluster集群搭建
The first topic of ape Anthropology
AutoCAD - Center zoom
Qt蓝牙:搜索蓝牙设备的类——QBluetoothDeviceDiscoveryAgent
中国艾草行业研究与投资前景预测报告(2022版)
Flink集群配置
mysql审计日志归档
2022 thinking of Mathematical Modeling B problem of American college students / analysis of 2022 American competition B problem
Understand encodefloatrgba and decodefloatrgba
mysql審計日志歸檔
An article takes you to thoroughly understand descriptors
JMeter -- distributed pressure measurement
[groovy] closure (Introduction to closure class closure | closure parametertypes and maximumnumberofparameters member usage)
【acwing】528. cheese
Chapter 6 text processing tools for shell programming (awk)
Advanced length of redis -- deletion strategy, master-slave replication, sentinel mode
flutter 对象和列表
[crampon programming] lintcode decoding Encyclopedia - 1100 strange printer
[PCL self study: feature9] global aligned spatial distribution (GASD) descriptor (continuously updated)
MD5 bypass