当前位置:网站首页>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
边栏推荐
- mysql审计日志归档
- AutoCAD - lengthening
- Download the details and sequence of the original data access from the ENA database in EBI
- [crampon game] MC tutorial - first day of survival
- 计组笔记(1)——校验码、原补码乘除计算、浮点数计算
- China as resin Market Research and investment forecast report (2022 Edition)
- [groovy] closure (closure parameter binding | curry function | rcurry function | ncurry function | code example)
- 3dsmax2018 common operations and some shortcut keys of editable polygons
- 49 pictures and 26 questions explain in detail what is WiFi?
- 2021 electrician Cup - high speed rail traction power supply system operation data analysis and equivalent modeling ideas + code
猜你喜欢
![[groovy] closure (closure parameter list rule | default parameter list | do not receive parameters | receive custom parameters)](/img/36/c4206a95c007e41df628d99e06ba18.jpg)
[groovy] closure (closure parameter list rule | default parameter list | do not receive parameters | receive custom parameters)
![[goweb development] Introduction to authentication modes based on cookies, sessions and JWT tokens](/img/20/5c5550e6dabc76702f0e7ce3bef068.jpg)
[goweb development] Introduction to authentication modes based on cookies, sessions and JWT tokens

数论函数及其求和 待更新

2022-2028 global and Chinese virtual data storage Market Research Report

Emlog blog theme template source code simple good-looking responsive
![Rip notes [rip message security authentication, increase of rip interface measurement]](/img/89/f70af97676496d7b9aa867be89f11d.jpg)
Rip notes [rip message security authentication, increase of rip interface measurement]

Autocad-- dynamic zoom

669. 修剪二叉搜索树 ●●

CUDA Programming atomic operation atomicadd reports error err:msb3721, return code 1

3dsmax scanning function point connection drawing connection line
随机推荐
【Leetcode】1352. Product of the last K numbers
AutoCAD - Document Management
On-off and on-off of quality system construction
MD5绕过
Setting up redis cluster cluster under Windows
The principle of attention mechanism and its application in seq2seq (bahadanau attention)
54. Spiral matrix & 59 Spiral matrix II ●●
Thinking of 2022 American College Students' mathematical modeling competition
Matplotlib draws three-dimensional scatter and surface graphs
AutoCAD - command repetition, undo and redo
MD5 bypass
[Chongqing Guangdong education] National Open University 2047t commercial bank operation and management reference test in autumn 2018
Error statuslogger log4j2 could not find a logging implementation
Decryption function calculates "task state and lifecycle management" of asynchronous task capability
Flutter tips: various fancy nesting of listview and pageview
Emlog博客主题模板源码简约好看响应式
Flutter 小技巧之 ListView 和 PageView 的各种花式嵌套
mysql審計日志歸檔
Special information | real estate and office buildings - 22.1.9
Stage experience