-
旋转:函数方法
Transform trans;
//Rotate沿着z轴每秒旋转speed度(自身旋转)
trans.Rotate(Vector3.forward * Time.deltaTime * speed);
2.//围绕旋转RotateAround();
trans.RotateAround(Vector3(x,y,z),target.up,Time.deltaTime * speed);
//参数1:围绕的点,参数2:绕哪个轴旋转,参数3:旋转速度
3.//LookAt()看向某物体(z轴指向某物体);
trans.LootAt(target);
查看全部 -
Transform.rotation;
旋转角度函数,使用的是四元数,
如果想使用欧拉角来旋转,需要转换成四元数
Transform trans;
trans.rotation = Quaternion.Eular(x,y,z);//相对世界坐标
trans.localRotation = Quaternion.Eular(x,y,z);//相对父物体坐标
查看全部 -
Transform.Translate(Vector3,Space)
参数1:每一帧移动的距离
参数2:移动参考方向
(Space.self:自身z方向--默认是自身,Space.world:世界z方向)
查看全部 -
Transform的成员:
1.position是相对于世界的坐标,
2,localPosition是相对于父物体的坐标
查看全部 -
move,
查看全部 -
vector3的一些用法
查看全部 -
常用变量4 方向向量
向右 right
向上 up
向前 forward
负数值为相反方向,上下左右向前向后都齐全了
子父级相关
父物体 parent
根物体 root
子物体数量 childCount
查看全部 -
常用变量3
相对父级缩放比例 localScale
相对实际缩放比例 lossyScale
查看全部 -
常用变量2
欧拉角 enlerAngles, localEnlerAngles
四元数旋转角度 rotation,localRotation
查看全部 -
常用变量之一
position 世界坐标
localPosition 相对坐标
查看全部 -
1、常用变量和属性
2、移动,旋转和放缩
3、常用函数
#!/usr/bin/python # -*- coding: UTF-8 -*- counter = 100 # 赋值整型变量 miles = 1000.0 # 浮点型 name = "John" # 字符串 print counterprint print miles print name
查看全部
举报