mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 06:11:29 +03:00
Added generic method for ResourceLoader: Load<T>()
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user