Unity3d 相机在鼠标轨道上移动

Unity3d 相机在鼠标轨道上移动,unity3d,Unity3d,这是旋转我的对象的函数。当我点击play并点击鼠标时(不管我在屏幕上的什么位置),我的相机正在通过设置来改变它的位置。有没有办法阻止这一切 我已经添加了2张图片的细节。我希望了解我的问题是什么。我通过在inspector中更改相机位置来解决问题 function LateUpdate () { if (isCameraInputIgnored() ) { return; } if (target && Input.GetMouseButton(0

这是旋转我的对象的函数。当我点击play并点击鼠标时(不管我在屏幕上的什么位置),我的相机正在通过设置来改变它的位置。有没有办法阻止这一切


我已经添加了2张图片的细节。我希望了解我的问题是什么。

我通过在inspector中更改相机位置来解决问题

function LateUpdate () {   
if (isCameraInputIgnored() ) {
        return;
}   

if (target && Input.GetMouseButton(0)) {
    x += Input.GetAxis("Mouse X") * xSpeed * 0.02;
    y -= Input.GetAxis("Mouse Y") * ySpeed * 0.02;

    y = ClampAngle(y, yMinLimit, yMaxLimit);

    var rotation = Quaternion.Euler(y, x, 0);

    var position = rotation * Vector3(0.0, 10.0, -distance) + target.position;

    transform.rotation = rotation;
    transform.position = position;
}
}