using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class player : MonoBehaviour {
public int speed = 2;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
float h = Input.GetAxis("Horizontal");//水平 ad
float v = Input.GetAxis("Vertical");//垂直输入量 ws
Vector3 moveVec = new Vector3(h, 0, v);
transform.Translate(moveVec * speed * Time.deltaTime);
}
}
移动代码
最新推荐文章于 2021-06-07 13:33:41 发布