Unity 旋转 Vector3.right Vector3(1,0,0) Vector3.left Vector3(-1,0,0) Vector3.up Vector3(0,1,0) Vector3.down Vector3(0,-1,0) Vector3.forward Vector3(0,0,1) Vector3.back Vector3(0,0,-1) Vector3.zero Vector3(0,0,0) Vector3.one Vector3(1,1,1)
自身旋转 Transform.Rotate(Vector eulers); Transform.Rotate(Vector eulers,space relativeTo); space relativeTo: Space.self 围绕自身坐标轴旋转 默认值为Space.self Space.World 围绕世界坐标轴旋转
自身旋转 旋转到某个角度 Transform.rotation = Quaternion.Euler(float x,float y,float z); 缓慢的旋转到某个角度 Transform.rotation = Quaternion.Slerp(Transform.rotation,Quaternion.Euler(60,60,60) , Time.deltaTime);
Transform.eulerAngles=new Vector3(); Transform.localEulerAngles =new Vector3();
围绕某个物体旋转 Transform.RotateAroud(Vector3 point, Vector3.axis,float angle); point:要围绕的点; axiw:要围绕的轴,如x,y,z angel:旋转的角度,角度越大,速度越快
|