mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-13 19:55:55 +00:00
Moving FSM Elevator
This commit is contained in:
parent
eef9bc71c1
commit
8b378abef3
22 changed files with 349 additions and 16 deletions
46
Scripts/Components/FSM/Elevator/Top.cs
Normal file
46
Scripts/Components/FSM/Elevator/Top.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
using Cirno.Scripts.Enums;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM.Elevator;
|
||||
|
||||
public partial class Top : BaseState<ElevatorState, ElevatorProxy>
|
||||
{
|
||||
public override ElevatorState StateId => ElevatorState.Top;
|
||||
public override void EnterState()
|
||||
{
|
||||
MainObject.SetPosition(MainObject.ElevatorPath.Curve.GetPointPosition(0));
|
||||
|
||||
MainObject.Activated += ElevatorActivated;
|
||||
}
|
||||
|
||||
private void ElevatorActivated(ActivationType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ActivationType.Use:
|
||||
case ActivationType.Toggle:
|
||||
MoveToBottom();
|
||||
break;
|
||||
case ActivationType.Enable:
|
||||
break;
|
||||
case ActivationType.Disable:
|
||||
break;
|
||||
case ActivationType.Destroy:
|
||||
break;
|
||||
case ActivationType.Open:
|
||||
break;
|
||||
case ActivationType.Close:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void MoveToBottom()
|
||||
{
|
||||
StateMachine.SetState(ElevatorState.Descending);
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
{
|
||||
MainObject.Activated -= ElevatorActivated;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue