关于Unity一般的输入操作方式

记录Unity一般的输入操作方式
下面附上我的代码

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TouchInput : MonoBehaviour
{
    public float moveSpeed = 5.0f;

    public float rotateSpeed = 5.0f;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        // Input.GetAxis("Horizontal");

        this.transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime*Input.GetAxis("Vertical"));

        this.transform.Rotate(Vector3.up * rotateSpeed * Time.deltaTime * Input.GetAxis("Vertical"));
    }
}

你可能感兴趣的:(Unity,unity,游戏引擎)