2026-10-06 18:50:28 +00:00
|
|
|
|
|
|
|
|
using Godot;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using Rokojori.Extensions;
|
|
|
|
|
namespace Rokojori
|
|
|
|
|
{
|
|
|
|
|
[GlobalClass, Tool ]
|
|
|
|
|
public partial class SetNode3D : Action
|
|
|
|
|
{
|
|
|
|
|
[Export]
|
|
|
|
|
public Node source;
|
|
|
|
|
|
|
|
|
|
[Export]
|
|
|
|
|
public string sourceMember;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Export]
|
|
|
|
|
public Node target;
|
|
|
|
|
|
|
|
|
|
[Export]
|
|
|
|
|
public string targetMember;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override void _OnTrigger()
|
|
|
|
|
{
|
|
|
|
|
if ( target == null || source == null )
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-09 08:39:14 +00:00
|
|
|
var value = sourceMember == null || sourceMember == "" ? (Node3D) source :
|
|
|
|
|
ReflectionHelper.GetValue<Node3D>( source, sourceMember );
|
2026-10-06 18:50:28 +00:00
|
|
|
|
|
|
|
|
ReflectionHelper.SetValue<Node3D>( target, targetMember, value );
|
|
|
|
|
|
|
|
|
|
}
|
2026-10-09 08:39:14 +00:00
|
|
|
|
|
|
|
|
|
2026-10-06 18:50:28 +00:00
|
|
|
}
|
|
|
|
|
}
|