当前位置:网站首页>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 can clothing stores make profits?
- 中英文说明书丨ProSci LAG-3 重组蛋白
- 2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书
- MySQL installation
- 二十岁的我4面拿到字节跳动offer,至今不敢相信
- Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]
- ip地址那点事
- Jetpack compose is much more than a UI framework~
- Basic introduction of JWT
- 请教一下,监听pgsql ,怎样可以监听多个schema和table
猜你喜欢
Comment les entreprises gèrent - elles les données? Partager les leçons tirées des quatre aspects de la gouvernance des données
Abnova 体外转录 mRNA工作流程和加帽方法介绍
品牌电商如何逆势增长?在这里预见未来!
POI export to excel: set font, color, row height adaptation, column width adaptation, lock cells, merge cells
Unable to debug screen program with serial port
Can 7-day zero foundation prove HCIA? Huawei certification system learning path sharing
Use of completable future
Stack and queue-p79-10 [2014 unified examination real question]
数据资产管理与数据安全国内外最新趋势
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
随机推荐
健身房如何提高竞争力?
from .onnxruntime_pybind11_state import * # noqa ddddocr运行报错
FPGA课程:JESD204B的应用场景(干货分享)
.net core 访问不常见的静态文件类型(MIME 类型)
毕业设计游戏商城
循环肿瘤细胞——Abnova 解决方案来啦
Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
CompletableFuture使用详解
Abnova 体外转录 mRNA工作流程和加帽方法介绍
精准时空行程流调系统—基于UWB超高精度定位系统
【JDBC以及内部类的讲解】
服装门店如何盈利?
关于数据库数据转移的问题,求各位解答下
ip地址那点事
Pinduoduo lost the lawsuit: "bargain for free" infringed the right to know but did not constitute fraud, and was sentenced to pay 400 yuan
Please answer the questions about database data transfer
jdbc数据库连接池使用问题
JWT certification
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第二阶段答案
Tool class: object to map hump to underline underline hump