cirnogodot/Scripts/Interactables/Switch.cs
2025-02-15 14:33:44 +01:00

20 lines
No EOL
473 B
C#

using Godot;
namespace Cirno.Scripts.Interactables;
public partial class Switch : Interactable
{
[Export] public Node2D Target { get; set; }
[Export] public ActivationType ActivationType { get; set; } = ActivationType.Toggle;
public override bool Activate()
{
if (MeetsRequirements() && Target is IActivable activable)
{
activable?.Activate(ActivationType);
return true;
}
return false;
}
}