当前位置:网站首页>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
边栏推荐
- Research and investment forecast report of adamantane industry in China (2022 Edition)
- AutoCAD - feature matching
- AutoCAD - continuous annotation
- 49 pictures and 26 questions explain in detail what is WiFi?
- Forecast report on research and investment prospects of Chinese wormwood industry (2022 Edition)
- The remainder operation is a hash function
- The 22nd Spring Festival Gala, an immersive stage for the yuan universe to shine into reality
- AutoCAD - set layer
- AutoCAD - isometric annotation
- How should programmers learn mathematics
猜你喜欢
[PCL self study: feature9] global aligned spatial distribution (GASD) descriptor (continuously updated)
数论函数及其求和 待更新
AutoCAD - isometric annotation
質量體系建設之路的分分合合
Wan broadband access technology V EPON Technology
AutoCAD - continuous annotation
Solutions and answers for the 2021 Shenzhen cup
Number theoretic function and its summation to be updated
PostgreSQL 超越 MySQL,“世界上最好的编程语言”薪水偏低
An article takes you to thoroughly understand descriptors
随机推荐
xss注入
The 22nd Spring Festival Gala, an immersive stage for the yuan universe to shine into reality
2022-2028 global and Chinese video coding and transcoding Market Research Report
Flutter 小技巧之 ListView 和 PageView 的各种花式嵌套
【acwing】528. cheese
中国聚氨酯硬泡市场调研与投资预测报告(2022版)
China as resin Market Research and investment forecast report (2022 Edition)
次小生成树
Detailed explanation of the ranking of the best universities
JVM 原理和流程简介
Pdf to DWG in CAD
Emlog blog theme template source code simple good-looking responsive
669. Prune binary search tree ●●
2022 thinking of mathematical modeling D problem of American college students / analysis of 2022 American competition D problem
2022 thinking of mathematical modeling C problem of American college students / analysis of 2022 American competition C problem
Is $20billion a little less? Cisco is interested in Splunk?
Understand encodefloatrgba and decodefloatrgba
3dsmax common commands
Error statuslogger log4j2 could not find a logging implementation
[crampon programming] lintcode decoding Encyclopedia - 1100 strange printer