如何在Unity 5中添加标准资产的操纵杆?

时间:2015-09-17 06:31:33

标签: c# android unity3d 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 中玩游戏,为此我需要使用操纵杆。谁能告诉我如何在标准资产中使用操纵杆?

2 个答案:

答案 0 :(得分:2)

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

答案 1 :(得分:-1)

删除Time.deltaTime,Time.deltaTime适用于Update()而不适用于FixedUpdate()......