当前位置:网站首页>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
边栏推荐
- Installing redis and windows extension method under win system
- ip地址那点事
- 基于JS的迷宫小游戏
- 请问 flinksql对接cdc时 如何实现计算某个字段update前后的差异 ?
- SVN version management in use replacement release and connection reset
- 大促过后,销量与流量兼具,是否真的高枕无忧?
- Matlab tips (30) nonlinear fitting lsqcurefit
- Performance comparison between Ceres solver and g2o
- AddressSanitizer 技术初体验
- Anr principle and Practice
猜你喜欢

数据资产管理与数据安全国内外最新趋势

Complete process of MySQL SQL

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

关于数据库数据转移的问题,求各位解答下

健身房如何提高竞争力?

服装门店如何盈利?

Stack and queue-p79-9

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

Unable to debug screen program with serial port

Config分布式配置中心
随机推荐
网络基础 —— 报头、封装和解包
如何给目标机器人建模并仿真【数学/控制意义】
Jetpack Compose 远不止是一个UI框架这么简单~
Config分布式配置中心
Prime partner of Huawei machine test questions
多线程与高并发(9)——AQS其他同步组件(Semaphore、ReentrantReadWriteLock、Exchanger)
反射(二)
Please ask a question, flick Oracle CDC, read a table without update operation, and repeatedly read the full amount of data every ten seconds
Problems and precautions about using data pumps (expdp, impdp) to export and import large capacity tables in Oracle migration
Jmeter 5.5版本发布说明
请教一下,监听pgsql ,怎样可以监听多个schema和table
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书
MOS管参数μCox得到的一种方法
How DHCP router works
Please tell me how to monitor multiple schemas and tables by listening to PgSQL
Learning records on July 4, 2022
Can't you really do it when you are 35 years old?
Big coffee gathering | nextarch foundation cloud development meetup is coming
Cloudcompare point pair selection
leetcode 509. Fibonacci Number(斐波那契数字)