mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-03 20:05:53 +00:00
34 lines
No EOL
965 B
C#
34 lines
No EOL
965 B
C#
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);
|
|
}
|
|
} |