-
后面两个没走.
改成
if(Input.mousePosition.x>= 960)
{
logoCamera.transform.Translate(-Vector3.right * Time.deltaTime * cameraSpeed);
}
else if (Input.mousePosition.x <= 960)
{
logoCamera.transform.Translate(Vector3.right * Time.deltaTime * cameraSpeed);
}
if (Input.mousePosition.y >= 540)
{
logoCamera.transform.Translate(-Vector3.up * Time.deltaTime * cameraSpeed);
}
else if (Input.mousePosition.y <= 540)
{
logoCamera.transform.Translate(Vector3.up * Time.deltaTime * cameraSpeed);
}就正常了,这是为什么?