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