数组的方式(自行调整倍数)
2、按钮 真实按钮 虚拟按钮
Mouse X Mouse Y
移动鼠标,摄像机旋转
脚本给camera实现镜头移动
上面用方法的形式减少资源浪费
飞机模型在plane上移动WASD来控制 float hor = Input.GetAxis("Horizontal");float ver = Input.GetAxis("Vertical");
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class air : MonoBehaviour
{
private void Update()
{
float hor = Input.GetAxis("Horizontal");
float ver = Input.GetAxis("Vertical");
if(hor!=0||ver!=0)
MoveMent(hor,ver);
}
public float movespeed = 10;
private void MoveMent(float hor,float ver)
{
hor *= movespeed * Time.deltaTime;
ver *= movespeed * Time.deltaTime;
this.transform.Translate(hor,0,ver);
}
}



