📅  最后修改于: 2022-03-11 15:00:31.840000             🧑  作者: Mango
private void Update() {
Rigidbody rb = GetComponent();
if (Input.GetKey(KeyCode.A))
rb.AddForce(Vector3.left);
if (Input.GetKey(KeyCode.D))
rb.AddForce(Vector3.right);
if (Input.GetKey(KeyCode.W))
rb.AddForce(Vector3.up);
if (Input.GetKey(KeyCode.S))
rb.AddForce(Vector3.down);