mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-04 11:35:54 +00:00
Made crosshair into a module
This commit is contained in:
parent
625466d2d7
commit
ddadb9bd04
10 changed files with 93 additions and 36 deletions
21
Scripts/Components/FSM/Player/PlayerNode2DModule.cs
Normal file
21
Scripts/Components/FSM/Player/PlayerNode2DModule.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM;
|
||||
|
||||
public abstract partial class PlayerNode2DModule : Node2D, IModule<PlayerState, CharacterBody2D>
|
||||
{
|
||||
public IStateMachine<PlayerState, CharacterBody2D> StateMachine { get; private set; }
|
||||
|
||||
public CharacterBody2D CharacterBody => StateMachine.MainObject;
|
||||
|
||||
|
||||
public abstract void EnterState(PlayerState state);
|
||||
public abstract void ExitState(PlayerState state);
|
||||
|
||||
public virtual void Init(IStateMachine<PlayerState, CharacterBody2D> machine)
|
||||
{
|
||||
StateMachine = machine;
|
||||
}
|
||||
public abstract void Process(double delta);
|
||||
public abstract void PhysicsProcess(double delta);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue