using Godot;
namespace Babushka.scripts.CSharp.Low_Code.Variables;
///
/// An active getter component for calling the payload value of a .
///
public partial class VariableGetter : Node
{
///
/// The event resource to listen to.
///
[Export] private VariableResource _variableResource;
///
/// A signal that is triggered when the payload of one of the is called.
///
[Signal] public delegate void GetPayloadEventHandler(Variant payload);
///
/// Gets the Variant payload of a VariableResource on demand.
///
///
public Variant Get()
{
Variant payload = _variableResource.Payload;
EmitSignal(SignalName.GetPayload, payload);
return payload;
}
}