mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
25 lines
No EOL
709 B
C#
25 lines
No EOL
709 B
C#
using Godot;
|
|
|
|
namespace Cirno.Scripts.Utils;
|
|
|
|
public static class ActivationHelper
|
|
{
|
|
public static bool UseTargets(Node activator, string target, ActivationType activationType = ActivationType.Toggle)
|
|
{
|
|
var res = false;
|
|
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}");
|
|
res |= activable.Activate(activationType);
|
|
}
|
|
}
|
|
|
|
return res;
|
|
}
|
|
} |