mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
51 lines
No EOL
1.2 KiB
C#
51 lines
No EOL
1.2 KiB
C#
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;
|
|
|
|
// Enable top body
|
|
MainObject.TopBody.Disabled = false;
|
|
|
|
}
|
|
|
|
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;
|
|
}
|
|
} |