当前位置:网站首页>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
边栏推荐
- MD5 bypass
- AutoCAD - Zoom previous
- English topic assignment (26)
- [groovy] closure closure (customize closure parameters | customize a single closure parameter | customize multiple closure parameters | specify the default value of closure parameters)
- History of web page requests
- CSDN body auto generate directory
- XSS injection
- 中国金刚烷行业研究与投资预测报告(2022版)
- Emlog blog theme template source code simple good-looking responsive
- MySQL audit log Archive
猜你喜欢
[groovy] closure closure (customize closure parameters | customize a single closure parameter | customize multiple closure parameters | specify the default value of closure parameters)
LeetCode之单词搜索(回溯法求解)
AutoCAD - isometric annotation
Special information | real estate and office buildings - 22.1.9
49 pictures and 26 questions explain in detail what is WiFi?
Rip notes [rip three timers, the role of horizontal segmentation, rip automatic summary, and the role of network]
AutoCAD - Center zoom
2022 thinking of mathematical modeling a problem of American college students / analysis of 2022 American competition a problem
数论函数及其求和 待更新
2022-2028 global and Chinese virtual data storage Market Research Report
随机推荐
Forecast report on research and investment prospects of Chinese wormwood industry (2022 Edition)
AutoCAD - continuous annotation
[ideas] 2021 may day mathematical modeling competition / May Day mathematical modeling ideas + references + codes
mysql审计日志归档
Introduce Hamming distance and calculation examples
CUDA Programming atomic operation atomicadd reports error err:msb3721, return code 1
#775 Div.1 C. Tyler and Strings 组合数学
Download the details and sequence of the original data access from the ENA database in EBI
3dsmax scanning function point connection drawing connection line
Is $20billion a little less? Cisco is interested in Splunk?
Rk3399 platform development series explanation (network debugging) 7.29 summary of network performance tools
2020-10-27
AutoCAD - stretching
Thematic information | carbon, carbon neutrality, low carbon, carbon emissions - 22.1.9
Autocad-- dynamic zoom
AutoCAD - workspace settings
MD5 bypass
3dsmax2018 common operations and some shortcut keys of editable polygons
[groovy] closure closure (customize closure parameters | customize a single closure parameter | customize multiple closure parameters | specify the default value of closure parameters)
2022 U.S. college students' mathematical modeling e problem ideas / 2022 U.S. game e problem analysis