当前位置:网站首页>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
边栏推荐
- Stack and queue-p79-9
- How can clothing stores make profits?
- from . onnxruntime_ pybind11_ State Import * noqa ddddocr operation error
- ANR 原理及实践
- Jetpack compose is much more than a UI framework~
- MySQL view bin log and recover data
- 从零到一,教你搭建「CLIP 以文搜图」搜索服务(二):5 分钟实现原型
- 偏执的非合格公司
- Get the city according to IP
- mysql查看bin log 并恢复数据
猜你喜欢

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

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

How to share the same storage among multiple kubernetes clusters

场馆怎么做体育培训?

Leetcode T1165: 日志分析

2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书

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

LVS+Keepalived(DR模式)学习笔记

Programmers' daily | daily anecdotes

Take you to brush (niuke.com) C language hundred questions (the first day)
随机推荐
MySQL user permissions
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第二阶段答案
from .onnxruntime_pybind11_state import * # noqa ddddocr运行报错
ViewModelProvider.of 过时方法解决
Jetpack Compose 远不止是一个UI框架这么简单~
FPGA课程:JESD204B的应用场景(干货分享)
libcurl返回curlcode说明
工具类:对象转map 驼峰转下划线 下划线转驼峰
DHCP路由器工作原理
品牌·咨询标准化
Problems and precautions about using data pumps (expdp, impdp) to export and import large capacity tables in Oracle migration
请教一个问题,flink oracle cdc,读取一个没有更新操作的表,隔十几秒就重复读取全量数据
【luogu P1971】兔兔与蛋蛋游戏(二分图博弈)
【mysqld】Can't create/write to file
华为机试题素数伴侣
Leetcode T1165: 日志分析
Abnova 免疫组化服务解决方案
中英文说明书丨ProSci LAG-3 重组蛋白
循环肿瘤细胞——Abnova 解决方案来啦
Distributed ID solution