Files
rpg_start/Assets/Player.cs
13659 8b196e9343 第一天
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 17:32:00 +08:00

18 lines
385 B
C#

using UnityEngine;
public class Player : MonoBehaviour
{
public Rigidbody2D rb;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
rb.linearVelocity = new Vector2(Input.GetAxis("Horizontal"), rb.linearVelocityY);
}
}