Blogger Information
Blog 10
fans 1
comment 0
visits 12500
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
unity常用方法库 持续跟新
GrMax的博客
Original
587 people have browsed it

记录nuity学习发开日志,常用代码库:

  1. transform //基础操作类
  2. transform.eulerAngles = new Vector3(0, 0, -90); //旋转
  3. this.transform.Translate(0, floval(), 0, Space.Self); //让当前对象向Y轴移动
  4. this.transform.up;//获取向上的向量 right向右 forward向下
  5. target.transform.position//获取当前对象的坐标
  6. float angle = Vector3.SignedAngle(Vector3(), Vector3(), Vector3.forward);//计算夹角
  7. this.transform.Rotate(0, 0, angle);//旋转对象
  8. Vector3 sp = Camera.main.WorldToScreenPoint(transform.position);//将对象位置转换为屏幕的位置
  9. Destroy(this.gameObject);//销毁对象
  10. GameObject bllo = Instantiate(gameObject);//创建预制体
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post