Interactable interface

This commit is contained in:
MaddoScientisto 2025-03-09 21:58:25 +01:00
commit 54d9824581
27 changed files with 102 additions and 61 deletions

View file

@ -7,7 +7,7 @@ namespace Cirno.Scripts.Interactables;
public partial class Switch : Interactable
{
[Export] public Node2D Target { get; set; }
[Export] public Array<Node2D> Targets { get; private set; } = new Array<Node2D>();
[Export] public Array<Node2D> Targets { get; private set; } = [];
[Export] public ActivationType ActivationType { get; set; } = ActivationType.Toggle;
private AudioStreamPlayer2D _activationSound;
@ -19,7 +19,7 @@ public partial class Switch : Interactable
_activationSound = GetNodeOrNull<AudioStreamPlayer2D>(_activationSoundName);
}
public override bool Activate()
public override bool Activate(ActivationType activationType = ActivationType.Toggle)
{
if (!MeetsRequirements()) return false;
_activationSound?.Play();