Added generic method for ResourceLoader: Load<T>()
This commit is contained in:
parent
317dee95de
commit
cdb4ae471b
2 changed files with 15 additions and 0 deletions
|
@ -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);
|
||||
|
|
10
modules/mono/glue/cs_files/ResourceLoaderExtensions.cs
Normal file
10
modules/mono/glue/cs_files/ResourceLoaderExtensions.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue