using UnityEngine; public class Movement2D : MonoBehaviour { [SerializeField] private float moveSpeed = 0.0f; [SerializeField] private Vector3 moveDirection = Vector3.zero; public float MoveSpeed => moveSpeed; void Update() { transform.position += moveDirection * moveSpeed * Time.deltaTime ; // 새로운 위치 = 기존 위치 + 방향 * 속도 } public void MoveTo(Vector3 direction) { moveDirection = direction; } }