2025-06-30 10:02:37 +02:00
|
|
|
|
using Godot;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Cirno.Scripts.Utils;
|
|
|
|
|
|
|
|
|
|
|
|
public static class ActivationHelper
|
|
|
|
|
|
{
|
2025-07-04 10:31:23 +02:00
|
|
|
|
public static void UseTargets(Node activator, string target, ActivationType activationType = ActivationType.Toggle)
|
2025-06-30 10:02:37 +02:00
|
|
|
|
{
|
|
|
|
|
|
GD.Print($"Trying to use targets called: {target}");
|
|
|
|
|
|
var targetList = activator.GetTree().GetNodesInGroup(target);
|
|
|
|
|
|
foreach (var t in targetList)
|
|
|
|
|
|
{
|
|
|
|
|
|
//string f;
|
|
|
|
|
|
GD.Print($"Trying to use {t.Name}");
|
|
|
|
|
|
if (t is IActivable activable)
|
|
|
|
|
|
{
|
|
|
|
|
|
GD.Print($"Activating {t.Name}");
|
2025-07-04 10:31:23 +02:00
|
|
|
|
activable.Activate(activationType);
|
2025-06-30 10:02:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|