2024-11-12 08:03:36 +00:00
|
|
|
using Godot;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
2026-05-22 12:25:02 +00:00
|
|
|
using Rokojori.Extensions;
|
2024-11-12 08:03:36 +00:00
|
|
|
namespace Rokojori
|
|
|
|
|
{
|
|
|
|
|
public class MakeResourcesUnique
|
|
|
|
|
{
|
|
|
|
|
public static void On( Node node )
|
|
|
|
|
{
|
|
|
|
|
var resourceFields = ReflectionHelper.GetFieldInfosOfType<Resource>( node );
|
|
|
|
|
|
|
|
|
|
for ( int i = 0; i < resourceFields.Count; i++ )
|
|
|
|
|
{
|
|
|
|
|
var rf = resourceFields[ i ];
|
|
|
|
|
var resource = (Resource) rf.GetValue( node );
|
|
|
|
|
var value = resource.Duplicate( true );
|
|
|
|
|
|
|
|
|
|
rf.SetValue( node, value );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|