Unity 中的移动旋转
//只能使用=方式移动,无法使用+= ,如果使用旋转到90的时候会出现无法旋转的情况
// 其中 5为目标位置,其中如果有父物体,选择角度为相对角度
- this.transform.localEulerAngles=new Vector3(5, 0, 0);
//同localEulerAngles 但参照物为世界坐标,只能使用=方式移动,无法使用+= ,如果使用旋转到90的时候会出现无法旋转的情况
this.transform.eulerAngles=new Vector3(5, 0, 0);
//通过四元数的选择角度为世界坐标,无法使用+=,四元数无法相加
Quaternion rotation= Quaternion.Euler(new Vector3(x, y,z));
Transform.rotation=rotation;
//通过四元数的选择角度为自身坐标,无法使用+=,四元数无法相加
Quaternion localRotation= Quaternion.Euler(new Vector3(x, y,z));
Transform.localRotation=localRotation;
//Rotate 选择可以选择 自身还是世界,该旋转为绕着new Vector3(1,0,3)轴进行旋转 ,这个旋转不会固定单个旋转轴,如果想要在旋转中保证一个值不发生改变,可以使用localEulerAngles和eulerAngles和rotation 通关修改值来实现
transfor