需求:播放的模型能够上下左右移动,放大缩小
左右移动
mCamera.transform.RotateAround(mRotatePoint.position,mCamera.transform.up,mRightSpeed * Input.GetAxis("Mouse X");
上下移动
mCamera.transform.RotateAround(mRotatePoint,position,mCamera.transform.right,mUpSpeed * Input.GetAxis("Mouse Y");
放大缩小
//里滑
if(Input.GetAxis("Mouse ScrollWheel") < 0)
{
if(mAnimationCamera.GetComponent<Camera>().fieldOfView <=100)
{
mAnimationCamera.GetComponent<Camera>().fieldOfView += 2;
}
if(mAnimationCamera.GetComponent<Camera>().orthographicSize <= 20)
{
mAnimationCamera.GetComponent<Camera>().orthographicSize += 0.5f;
}
}
//外滑
if(Input.GetAxis("Mouse ScrollWheel") > 0)
{
if (mAnimationCamera.GetComponent<Camera>().fieldOfView > 25)
{
mAnimationCamera.GetComponent<Camera>().fieldOfView -= 2;
}
if (mAnimationCamera.GetComponent<Camera>().orthographicSize >= 1)
{
mAnimationCamera.GetComponent<Camera>().orthographicSize -= 0.5f;
}
}