📜  unity 3d 相机上下旋转 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:56.099000             🧑  作者: Mango

代码示例1
public class CamRot : MonoBehaviour
{
    public float rotationSpeed = 50;

    void Update()
    {
        Vector3 rotation = transform.eulerAngles;

        rotation.x -= Input.GetAxis("Mouse Y") * rotationSpeed * Time.deltaTime;

        transform.eulerAngles = rotation;
    }
}