SupaLidlGame/Utils/ResourcePath.cs

23 lines
411 B
C#
Raw Permalink Normal View History

2023-12-29 17:45:36 -08:00
using Godot;
namespace SupaLidlGame.Utils;
[GlobalClass]
public partial class ResourcePath : Resource
{
private static Godot.Collections.Dictionary<string, Resource> _loaded;
static ResourcePath()
{
_loaded = new();
}
[Export(Godot.PropertyHint.File)]
public string Path { get; set; }
public T Load<T>() where T : Resource
{
return GD.Load<T>(Path);
}
}