Files
XCSDD/docs/api/resources/resourcemanager/loadgroup.md
ssdfasd 58a83f445a fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling
- Improve link styling with underline decoration
- Hide leaf nodes from tree, only show directories
- Fix log file path for packaged app
2026-03-19 12:44:08 +08:00

939 B
Raw Blame History

ResourceManager::LoadGroup

template<typename T>
void LoadGroup(const Containers::Array<Containers::String>& paths,
               std::function<void(ResourceHandle<T>)> callback)

批量异步加载同类资源。为路径数组中的每个路径提交一个异步加载请求,所有加载完成时通过回调通知。

参数:

  • paths - 资源路径数组
  • callback - 每个资源加载完成时的回调

返回:

复杂度: O(k)k 为路径数量(每个加载为 O(n)

示例:

Containers::Array<Containers::String> texPaths = {
    "textures/a.png", "textures/b.png", "textures/c.png"
};
ResourceManager::Get().LoadGroup<Texture>(texPaths,
    [](ResourceHandle<Texture> tex) {
        if (tex.IsValid()) {
            printf("Loaded: %s\n", tex->GetPath().CStr());
        }
    });

相关文档