using UnityEngine; public class PlayerMovement : MonoBehaviour { public Rigidbody2D rb; public FlightForce = new Vector2(0f, 10f); // Update is called once per frame void Update() { if (Input.GetKeyDown("space")) { rb.AddForce(FlightForce, ForceMode2D.Force); } } } using System.Co...
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystems; public class Player : MonoBehaviour { public float speed = 5f; // 修正后的代码 private Rigidbody2D _rigidbody2D; private Animator _animator; void Start() { _rigidbody2D = GetComponent&...