当前位置:网站首页>Unity3d learning notes
Unity3d learning notes
2022-07-07 07:01:00 【Tool man of konjaku】
C# Basics
// Input
int.parse(Console.ReadLine());
// Output
Console.WriteLine();
Pass in object x
Person xiaoming = object x as Person
unity3d
Class inheritance in the script has three default functions
Awake() Start() Update()
And variables 
Commonly used gameObject,transform…
translation
transform.Translate(Vector3. up * Time. deltaTime)
rotate
Show
setActive(boolean)
tip: Shortcut key Ctrl+N New scene
API
The coordinate is a three-dimensional vector
To obtain position , size , Rotating information
transform.position、rotation、localScale
Get other objects
Object object= GameObject.Find(" Object name ");
Object object= GameObject.FindWithTag(" Object tag name ");
Get components
Component comp=gameObject.GetComponent<>()
Calling method
Invoke("Func", 1.0); //1s Post trigger Func function
call ( Other objects ) Method
SendMessge() command : One calls instructions on other objects ( That is, the function in the script on the object ) Methods
Instantiate an object ( Copy )
Instantiate(object, transform.position, rotation);
Destruction of objects
Destroy(gameObject,3.0); // 3 Destroy the object in seconds
Collision events
If Is Trigger Option is checked , Once the object collides , No physical interaction , Will produce 3 Collision information is sent to the script parameters , Namely OnTriggerEnter、OnTriggerExit、OnTriggerStay. It is often used in picking and other events .
Rewriting methods
Collider callback method :( stop )
// The collision begins
void OnCollisionEnter(Collision other)
// During the collision , Once per frame
void OnCollisionStay(Collision other)
// End of collision
void OnCollisionExit(Collision other)
Trigger callback method :
// Trigger start
void OnTriggerEnter(Collider other)
// During triggering , Once per frame
void void OnTriggerStay(Collider other)
// Trigger end
void OnTriggerExit(Collider other)
Input
边栏推荐
- How to do sports training in venues?
- Programmers' daily | daily anecdotes
- Kotlin之 Databinding 异常
- libcurl返回curlcode说明
- 7天零基础能考证HCIA吗?华为认证系统学习路线分享
- 当前发布的SKU(销售规格)信息中包含疑似与宝贝无关的字
- Jetpack Compose 远不止是一个UI框架这么简单~
- Initial experience of addresssanitizer Technology
- CompletableFuture使用详解
- Learning records on July 4, 2022
猜你喜欢

Master-slave replication principle of MySQL

unity3d学习笔记

LC 面试题 02.07. 链表相交 & LC142. 环形链表II

毕业设计游戏商城

Answer to the first stage of the assignment of "information security management and evaluation" of the higher vocational group of the 2018 Jiangsu Vocational College skills competition

企业如何进行数据治理?分享数据治理4个方面的经验总结

循环肿瘤细胞——Abnova 解决方案来啦

快速定量,Abbkine 蛋白质定量试剂盒BCA法来了!

反射(二)

Maze games based on JS
随机推荐
LC 面试题 02.07. 链表相交 & LC142. 环形链表II
Learning records on July 4, 2022
AddressSanitizer 技术初体验
MySQL (x)
Lvs+kept (DR mode) learning notes
DB2获取表信息异常:Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][4.25.13]
How DHCP router works
大咖云集|NextArch基金会云开发Meetup来啦
.net 5 FluentFTP连接FTP失败问题:This operation is only allowed using a successfully authenticated context
使用net core优势/为什么使用
Please tell me how to monitor multiple schemas and tables by listening to PgSQL
2018 Jiangsu Vocational College skills competition vocational group "information security management and evaluation" competition assignment
Stack and queue-p78-8 [2011 unified examination true question]
Installing redis and windows extension method under win system
Sqlserver multithreaded query problem
libcurl返回curlcode说明
Jetpack compose is much more than a UI framework~
Config distributed configuration center
Answer to the first stage of the assignment of "information security management and evaluation" of the higher vocational group of the 2018 Jiangsu Vocational College skills competition
Learning notes | data Xiaobai uses dataease to make a large data screen