mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:05:34 +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
|
|
@ -166,7 +166,7 @@ public partial class Active : PlayerStateBase
|
|||
_animationProvider.SetAnimationSpeed(MainObject.Velocity);
|
||||
_animationProvider.SetAnimation(FacingDirection);
|
||||
|
||||
_crosshairProvider.UpdatePosition(FacingDirection);
|
||||
//_crosshairProvider.UpdatePosition(FacingDirection);
|
||||
|
||||
HandleShoot();
|
||||
|
||||
|
|
|
|||
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);
|
||||
}
|
||||
1
Scripts/Components/FSM/Player/PlayerNode2DModule.cs.uid
Normal file
1
Scripts/Components/FSM/Player/PlayerNode2DModule.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bkowl104hcpu7
|
||||
Loading…
Add table
Add a link
Reference in a new issue