这里给主相机绑定一个脚本. 脚本写为: using UnityEngine; using System.Collections; public class camerafollow : MonoBehaviour { //主摄像机跟随主角一起移动 public float xMargin = 1f; public float yMargin = 1f; public float xSmooth = 8f; public float ySmooth = 8f; public Vector2 max…
//将以下代码绑定到相机上 using UnityEngine; using System.Collections; public class LookatScipt : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { float x = Input.GetAxis ("Horizontal&qu…