如何从 Unity 5 中的标准资产添加操纵杆?
How to add a Joystick from Standard Assets in Unity 5?
我完全是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。还有一个关于实施的视频教程。
删除 Time.deltaTime,Time.deltaTime 用于 Update() 而不是 FixedUpdate()...
我完全是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。还有一个关于实施的视频教程。
删除 Time.deltaTime,Time.deltaTime 用于 Update() 而不是 FixedUpdate()...