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

36 lines
939 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ResourceManager::LoadGroup
```cpp
template<typename T>
void LoadGroup(const Containers::Array<Containers::String>& paths,
std::function<void(ResourceHandle<T>)> callback)
```
批量异步加载同类资源。为路径数组中的每个路径提交一个异步加载请求,所有加载完成时通过回调通知。
**参数:**
- `paths` - 资源路径数组
- `callback` - 每个资源加载完成时的回调
**返回:**
**复杂度:** O(k)k 为路径数量(每个加载为 O(n)
**示例:**
```cpp
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());
}
});
```
## 相关文档
- [ResourceManager 总览](resourcemanager.md) - 返回类总览