mirror of
https://github.com/godotengine/godot.git
synced 2025-02-17 22:43:01 +08:00
Added generic method for ResourceLoader: Load<T>()
This commit is contained in:
parent
317dee95de
commit
cdb4ae471b
@ -64,6 +64,11 @@ namespace Godot
|
|||||||
return ResourceLoader.Load(path);
|
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)
|
public static void Print(params object[] what)
|
||||||
{
|
{
|
||||||
NativeCalls.godot_icall_Godot_print(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 New Issue
Block a user