/// <summary> /// Loads a resource at the specified path. If resource is already loaded an existing instance is returned. /// </summary> /// <remarks> /// If running outside of the editor you must make sure to mark that the resource gets included in the build. If /// running inside the editor this has similar functionality as if loading using the project library. /// </remarks> /// <typeparam name="T">Type of the resource.</typeparam> /// <param name="path">Path of the resource, relative to game directory. If running from editor this will be /// relative to the project library. If a sub-resource within a file is needed, append the name /// of the subresource to the path (for example mymesh.fbx/my_animation).</param> /// <param name="flags">Flags used to control the load process.</param> /// <returns>Loaded resource, or null if resource cannot be found.</returns> public static T Load <T>(string path, ResourceLoadFlag flags = ResourceLoadFlag.Default) where T : Resource { return((T)Internal_Load(path, flags)); }
private static extern RRefBase Internal_LoadAsyncFromUUID(ref UUID uuid, ResourceLoadFlag flags);
private static extern Resource Internal_LoadFromUUID(ref UUID uuid, ResourceLoadFlag flags);
private static extern RRefBase Internal_LoadAsync(string path, ResourceLoadFlag flags);
private static extern Resource Internal_Load(string path, ResourceLoadFlag flags);