iFactory.Godot/addons/BITPlugins/RegistryPlugin.cs

18 lines
470 B
C#
Raw Normal View History

2023-06-15 21:52:13 +08:00
using Godot;
namespace BITKit;
#if TOOLS
[Tool]
public partial class RegistryPlugin : EditorPlugin
{
public override void _EnterTree()
{
var type = typeof(StringResource);
const string classPath = "res://Artists/Scripts/Resource/StringResource.cs";
var script = GD.Load<Script>(classPath);
GD.Print($"已加载{script.ResourceName??script.ToString()}");
AddCustomType(type.Name, "Resource", script, null);
}
}
#endif