当前位置:网站首页>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
边栏推荐
- jdbc数据库连接池使用问题
- SolidWorks GB Library (steel profile library, including aluminum profile, aluminum tube and other structures) installation and use tutorial (generating aluminum profile as an example)
- How can gyms improve their competitiveness?
- MOS管参数μCox得到的一种方法
- 毕业设计游戏商城
- Stack and queue-p79-10 [2014 unified examination real question]
- 健身房如何提高竞争力?
- ESXI挂载移动(机械)硬盘详细教程
- JDBC database connection pool usage problem
- This article introduces you to the characteristics, purposes and basic function examples of static routing
猜你喜欢

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

偏执的非合格公司

String (explanation)

Installing redis and windows extension method under win system

Take you to brush (niuke.com) C language hundred questions (the first day)

反射(二)

Lvs+kept (DR mode) learning notes

Mysql---- import and export & View & Index & execution plan

Please answer the questions about database data transfer

Jetpack Compose 远不止是一个UI框架这么简单~
随机推荐
一文带你了解静态路由的特点、目的及配置基本功能示例
POI export to excel: set font, color, row height adaptation, column width adaptation, lock cells, merge cells
品牌·咨询标准化
企業如何進行數據治理?分享數據治理4個方面的經驗總結
Please tell me how to monitor multiple schemas and tables by listening to PgSQL
偏执的非合格公司
MySQL installation
多线程与高并发(9)——AQS其他同步组件(Semaphore、ReentrantReadWriteLock、Exchanger)
JESD204B时钟网络
Basic introduction of JWT
服装门店如何盈利?
Mysql---- import and export & View & Index & execution plan
MATLAB小技巧(30)非线性拟合 lsqcurefit
Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
MYSQL binlog相关命令
Stack and queue-p79-10 [2014 unified examination real question]
Anr principle and Practice
How Oracle backs up indexes
leetcode 509. Fibonacci Number(斐波那契数字)
Libcurl returns curlcode description