Unity2D對象移動的幾種方法

1.改變對象速度spa rb = GetComponent<Rigidbody2D>(); if (Input.GetKey(KeyCode.LeftArrow)) { rb.velocity = new Vector2(-movespeed, rb.velocity.y); } if (Input.GetKey(KeyCode.RightArrow)) { rb.velocity = new
相關文章
相關標籤/搜索