Added generic method for ResourceLoader: Load<T>()

This commit is contained in:
exts 2018-07-30 06:35:48 -05:00
parent 317dee95de
commit cdb4ae471b
2 changed files with 15 additions and 0 deletions

View file

@ -64,6 +64,11 @@ namespace Godot
return ResourceLoader.Load(path);
}
public static T Load<T>(string path) where T : Godot.Resource
{
return (T) ResourceLoader.Load(path);
}
public static void Print(params object[] what)
{
NativeCalls.godot_icall_Godot_print(what);

View file

@ -0,0 +1,10 @@
namespace Godot
{
public static partial class ResourceLoader
{
public static T Load<T>(string path) where T : Godot.Resource
{
return (T) Load(path);
}
}
}