29 lines
600 B
C#
29 lines
600 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace NBF
|
|
{
|
|
public class FPlayerData : MonoService<FPlayerData>
|
|
{
|
|
private PlayerState _playerState;
|
|
|
|
public bool Run;
|
|
public bool IsGrounded;
|
|
public float Speed;
|
|
public float RotationSpeed;
|
|
|
|
public Vector2 MoveInput;
|
|
|
|
public PlayerState State
|
|
{
|
|
get => _playerState;
|
|
set
|
|
{
|
|
_playerState = value;
|
|
OnStateChange?.Invoke(_playerState);
|
|
}
|
|
}
|
|
|
|
public event Action<PlayerState> OnStateChange;
|
|
}
|
|
} |