Unity 物体旋转方法

1.transform.rotation

transform.rotation = Quaternion.Euler(new Vector3(0f,0f,45f));

2.tranfrom.Rotate

transform.Rotate(Vector3.forward*Time.deltaTime*speed,Space.Self);

3.transform.localEulerAngles

transform.localEulerAngles = new Vector3(0f, 0f, 45f);

4.transform.eulerAngles

transform.eulerAngles= new Vector3(0f, 0f, 45f);

5.transform.localRotation

private void Update()
{
        transform.localRotation = Quaternion.Lerp(transform.localRotation, Quaternion.Euler(new Vector3(0f, 0f, 90f)), Time.deltaTime * 1f);
}

6.transform.RotateAround(已弃用)

transform.RotateAround(new Vector3(0,0,0),3f);

 

你可能感兴趣的:(Unity 物体旋转方法)