MonoBehaviour { [SerializeField] private Transform _transform; [SerializeField] private float _speed = 0.1f; [SerializeField] private InputReader _inputReader; [SerializeField] private Mover _mover; private Vector3 _forward => _transform.forward; pivate void OnValidate() { _transform = _transform ?? Transform; } private void Update() { if(_inputReader. IsHorizontalKeyDown >= 1f) { _mover. Move(_forward, _speed); } } } } クラスをつなげる