当前位置:网站首页>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
边栏推荐
- Lvs+kept (DR mode) learning notes
- 快速定量,Abbkine 蛋白质定量试剂盒BCA法来了!
- 途家、木鸟、美团……民宿暑期战事将起
- Programmers' daily | daily anecdotes
- sqlserver多线程查询问题
- Abnova 体外转录 mRNA工作流程和加帽方法介绍
- 多线程与高并发(9)——AQS其他同步组件(Semaphore、ReentrantReadWriteLock、Exchanger)
- Answer to the second stage of the assignment of "information security management and evaluation" of the higher vocational group of the 2018 Jiangsu Vocational College skills competition
- .net core 访问不常见的静态文件类型(MIME 类型)
- Under what circumstances should we consider sub database and sub table
猜你喜欢

Take you to brush (niuke.com) C language hundred questions (the first day)
![Stack and queue-p78-8 [2011 unified examination true question]](/img/df/72ba22f1953551943494d661a56a3b.jpg)
Stack and queue-p78-8 [2011 unified examination true question]

Bus message bus

From zero to one, I will teach you to build the "clip search by text" search service (2): 5 minutes to realize the prototype

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

Redhat5 installing vmware tools under virtual machine

FPGA课程:JESD204B的应用场景(干货分享)

Data of all class a scenic spots in China in 2022 (13604)

Can 7-day zero foundation prove HCIA? Huawei certification system learning path sharing

How to do sports training in venues?
随机推荐
Under what circumstances should we consider sub database and sub table
Algorithm --- bit count (kotlin)
oracle如何备份索引
POI export to excel: set font, color, row height adaptation, column width adaptation, lock cells, merge cells
学术报告系列(六) - Autonomous Driving on the journey to full autonomy
Stack and queue-p79-10 [2014 unified examination real question]
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]
Unity C# 函数笔记
如何给目标机器人建模并仿真【数学/控制意义】
【luogu P1971】兔兔与蛋蛋游戏(二分图博弈)
mysql查看bin log 并恢复数据
多学科融合
Abnova循环肿瘤DNA丨全血分离,基因组DNA萃取分析
快速定量,Abbkine 蛋白质定量试剂盒BCA法来了!
MYSQL binlog相关命令
How to install swoole under window
DB2获取表信息异常:Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][4.25.13]
从零到一,教你搭建「CLIP 以文搜图」搜索服务(二):5 分钟实现原型
企业如何进行数据治理?分享数据治理4个方面的经验总结
Linear algebra (1)