using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UIElements;

public class Player : MonoBehaviour
{
    private float moveX;
    private float moveY;
    private Rigidbody2D rb2;
    private float speedData;
    
    // Start is called before the first frame update
    void Start()
    {
        //コンポーネント取得
        rb2 = GetComponent<Rigidbody2D>();
        
        //スピード係数
        speedData = 5.0f;
    }

    // Update is called once per frame
    void Update()
    {
        //入力判定
        moveX = Input.GetAxisRaw("Horizontal");
        moveY = Input.GetAxisRaw("Vertical");
        
        //移動
        rb2.velocity = new Vector2(moveX * speedData, moveY * speedData);
    }
}
