键盘位移控制(unity)
using UnityEngine;
using System.Collections;
public class MoveCtl : MonoBehaviour {
private float speed = 0.1f;
// Update is called once per frame
void Update () {
float moveX = Input.GetAxis("Horizontal");
float moveY = Input.GetAxis("Vertical");
this.transform.Translate(new Vector3(moveX, 0, moveY) * speed);
}
}
浙公网安备 33010602011771号