28 lines
690 B
C#
28 lines
690 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class MovementBehaviour : MonoBehaviour {
|
|
[SerializeField]
|
|
private float _movementSpeed = 1.0f;
|
|
private Vector3 _desiredMovementDirection = Vector3.zero;
|
|
public Vector3 DesiredMovementDirection
|
|
{
|
|
get => _desiredMovementDirection;
|
|
set => _desiredMovementDirection = value;
|
|
}
|
|
private void Update()
|
|
{
|
|
HandleMovement();
|
|
}
|
|
private void HandleMovement()
|
|
{
|
|
Vector3 movement = _desiredMovementDirection.normalized;
|
|
movement *= _movementSpeed;
|
|
transform.position += movement;
|
|
}
|
|
public void Jump()
|
|
{
|
|
}
|
|
}
|