2021-01-27 12:27:56 +01:00
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class PlayerController : MonoBehaviour
|
|
|
|
{
|
|
|
|
[SerializeField]
|
|
|
|
private PlayerMovementSettings _movementSettings;
|
|
|
|
|
|
|
|
[SerializeField]
|
|
|
|
private PlayerInputHandler _inputHandler;
|
|
|
|
|
|
|
|
[SerializeField]
|
|
|
|
private Rigidbody _rigidbody;
|
|
|
|
|
|
|
|
private void Start()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
private void FixedUpdate()
|
|
|
|
{
|
2021-01-27 13:06:17 +01:00
|
|
|
Vector2 moveVector2 = _inputHandler.InputState.Move.Value;
|
2021-01-27 12:27:56 +01:00
|
|
|
Vector3 moveVector = new Vector3( moveVector2.x, 0f, moveVector2.y );
|
|
|
|
|
|
|
|
_rigidbody.velocity = moveVector * _movementSettings.BaseMovementSpeed;
|
2021-02-15 10:44:04 +01:00
|
|
|
|
2021-01-27 12:27:56 +01:00
|
|
|
}
|
|
|
|
}
|