mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
43 lines
No EOL
967 B
C#
43 lines
No EOL
967 B
C#
using Godot;
|
|
|
|
namespace Cirno.Scripts.Components.FSM._3DPlayer;
|
|
|
|
public partial class PlayerAcidDeathModule : ModuleBase<PlayerState, CharacterBody3D>
|
|
{
|
|
private IStateMachine<PlayerState, CharacterBody3D> _stateMachine;
|
|
private CharacterBody3D MainObject => _stateMachine.MainObject;
|
|
|
|
private bool _enabled = false;
|
|
|
|
public override void EnterState(PlayerState state)
|
|
{
|
|
_enabled = true;
|
|
}
|
|
|
|
public override void ExitState(PlayerState state)
|
|
{
|
|
_enabled = false;
|
|
}
|
|
|
|
public override void Init(IStateMachine<PlayerState, CharacterBody3D> machine)
|
|
{
|
|
_stateMachine = machine;
|
|
}
|
|
|
|
public override void Process(double delta)
|
|
{
|
|
|
|
}
|
|
|
|
public override void PhysicsProcess(double delta)
|
|
{
|
|
|
|
}
|
|
|
|
public void OnAcidCollision(Area3D area)
|
|
{
|
|
if (!_enabled) return;
|
|
GD.Print("Oh no acid");
|
|
_stateMachine.SetState(PlayerState.Dead);
|
|
}
|
|
} |