QQ群:476842922(欢迎加群讨论学习)
将代码拖入到主摄像头上即可实现视角移动
using UnityEngine;
using System.Collections;
public class FSInput : MonoBehaviour {
public float speed=6.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
float deltaX = Input.GetAxis ("Horizontal") * speed;
float deltaZ = Input.GetAxis ("Vertical") * speed;
transform.Translate (deltaX, 0, deltaZ);
}
}