20 lines
655 B
C#
20 lines
655 B
C#
using Godot;
|
|
|
|
namespace DRPGActionGame.Player.States;
|
|
|
|
public abstract partial class State : Node2D {
|
|
private StateFactory.States actualState;
|
|
private AnimationNodeStateMachinePlayback? animation;
|
|
protected Player Player = new();
|
|
public abstract void ExitState();
|
|
|
|
public override void _Ready() => Player = GetParent<Player>();
|
|
|
|
public void Setup(StateFactory.States newState, AnimationNodeStateMachinePlayback? newAnimation, Player newPlayer) {
|
|
Name = newState.ToString();
|
|
GD.Print($"Switched to {Name} state.");
|
|
actualState = newState;
|
|
animation = newAnimation;
|
|
Player = newPlayer;
|
|
}
|
|
} |