using UnityEngine;
using UnityEngine.UI;
public class move : MonoBehaviour {
private float speed = 10f;//初始速度
public bool isPPP = false;//这是一个检测的状态
public Toggle to;//UI
public Text toText;//文本
void Update () {
float v = Input.GetAxis("Vertical");
ChangeSpeed();//调用状态检测的方法
if (isPPP == false)//判断这个状态下是初始速度
{
if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.S))
{
float ratation = v * speed * Time.deltaTime;
transform.Translate(r
物体移动时按下Shift键加快速度
最新推荐文章于 2024-06-05 19:01:12 发布