美文网首页
Unity物体旋转的方式

Unity物体旋转的方式

作者: 豆铮 | 来源:发表于2018-09-01 15:15 被阅读20次

第一种

transform.Rotate(new Vector3(90, 0, 0));

transform.Rotate(0,25*Time.deltaTime ,0,Space.Self );

第二种

transform.Rotate(Vector3.up ,90);

第三种

transform.rotation = Quaternion.Euler(45, 45, 45);

第四种 

Quaternion targetRotation =   Quaternion.Euler(45, 45, 45);

transform.rotation=Quaternion.Slerp(transform.rotation,targetRotation,Time.deltaTime *3);

第五种

transform.RotateAround(new Vector3(5, 5, 1), Vector3.up, 20*Time.deltaTime);

第六种

transform.eulerAngles = new Vector3(90, 0, 0);

transform.localEulerAngles  = new Vector3(90, 0, 0);

相关文章

网友评论

      本文标题:Unity物体旋转的方式

      本文链接:https://www.haomeiwen.com/subject/mukuwftx.html