mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 18:35:54 +00:00
Moving FSM Elevator
This commit is contained in:
parent
eef9bc71c1
commit
8b378abef3
22 changed files with 349 additions and 16 deletions
34
Scripts/Components/FSM/Elevator/ElevatorProxy.cs
Normal file
34
Scripts/Components/FSM/Elevator/ElevatorProxy.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using Cirno.Scripts.Enums;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM.Elevator;
|
||||
|
||||
public partial class ElevatorProxy : Area2D, IActivable
|
||||
{
|
||||
[Export]
|
||||
public ElevatorState StartingState { get; protected set; } = ElevatorState.Bottom;
|
||||
|
||||
[Export]
|
||||
public float MovementTime { get; protected set; } = 1.0f;
|
||||
|
||||
[Export]
|
||||
public Path2D ElevatorPath { get; protected set; }
|
||||
|
||||
[Signal] public delegate void ActivatedEventHandler(ActivationType type);
|
||||
|
||||
public Vector2 Top => ElevatorPath.Curve.GetPointPosition(0);
|
||||
|
||||
public Vector2 Bottom => ElevatorPath.Curve.GetPointPosition(1);
|
||||
|
||||
public IStateMachine<ElevatorState,ElevatorProxy> StateMachine { get; set; }
|
||||
// public void SetPosition(Vector2 position)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
|
||||
public void Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
EmitSignal(SignalName.Activated, (int)activationType);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue