c# - 如何从 Unity 5 中的标准 Assets 添加操纵杆?

标签 c# android unity-game-engine joystick

我完全是 Unity 的初学者(3 天前下载了 Unity)。我创建了一个简单的游戏,我可以使用这段代码用键盘移动玩家 -

void FixedUpdate () {
            float speed = 250;
    float moveHorizontal = Input.GetAxis ("Horizontal");
    float moveVertical = Input.GetAxis ("Vertical");

    Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    GetComponent<Rigidbody>().AddForce (movement * speed * Time.deltaTime);
}

但是,我想在 Android 中玩游戏,为此我需要使用操纵杆。谁能告诉我如何使用 Standard Assets 中的操纵杆?

最佳答案

我有帮助this Asset .还有一个关于实现的视频教程。

关于c# - 如何从 Unity 5 中的标准 Assets 添加操纵杆?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32623860/

相关文章:

c# - 使用来自 Unity C# 的参数运行 .exe 文件

c# - 如何在 Unity 中创建显示列表列表的自定义检查器?

c# - KendoUI 级联下拉列表,需要 2 个下拉列表中的值。

c# - Dotless Parse 不会缩小回车

android - 如何从游标存储一行

Android Support Repository 23.2.1 RecyclerView 错误

android - 为什么我的 WebView 没有填满屏幕的整个宽度?

unity-game-engine - 使用 HDRP 渲染管线

c# - 混合私有(private) NuGet 提要和 NEST 时“dotnet restore”失败

c# - 从代码执行时 Handle.exe 不工作