相机控制【Low版】

if (Input.GetAxis("Mouse ScrollWheel") > 0)
GetComponentInChildren<Camera>().fieldOfView--;


if (Input.GetAxis("Mouse ScrollWheel") < 0)

GetComponentInChildren<Camera>().fieldOfView++;


有问题的控制相机:

public class LookAtControl : MonoBehaviour {
    public Transform Target;
// Update is called once per frame
void Update () {
        transform.LookAt(Target);
        float h = Input.GetAxis("Mouse X");
        float v = Input.GetAxis("Mouse Y");
        if( Input.GetMouseButton(1))
            transform.localEulerAngles = Vector3.up * h * 50;
    }
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章