Version: 2017.2

Transform.localRotation

切换到手册
public Quaternion localRotation ;

描述

相对于父变换旋转的变换旋转。

Unity stores rotations as Quaternions internally. To rotate an object, use Transform.Rotate. Use Transform.localEulerAngles for modifying the rotation as euler angles.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Example() { transform.localRotation = Quaternion.identity; } }