1
我有一個左移動腳本,我想在Unity3D中使用我的精靈角色。 我想要它,只要guiTexture被按下,精靈就會移動。 下面是運動的腳本:用guiTexture移動2D角色
public float maxSpeed = 10f;
public GameObject player;
void Start() {}
void FixedUpdate() {
float move = Input.GetAxis ("Horizontal");
if (move < 0) {
move = move;
}
rigidbody2D.velocity = new Vector2 (move * maxSpeed, rigidbody2D.velocity.y);
}
請問這仍然工作在移動設備上? – 2014-09-03 20:42:55
實際上移動設備沒有鼠標連接,其中大部分工作在觸摸邏輯上我編輯了我的移動設備答案以及看看。 – 2014-09-04 06:25:29