28 lines
541 B
Markdown
28 lines
541 B
Markdown
|
|
# ResourceManager::GetLoader
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
IResourceLoader* GetLoader(ResourceType type) const
|
||
|
|
```
|
||
|
|
|
||
|
|
获取指定类型的资源加载器。
|
||
|
|
|
||
|
|
**参数:**
|
||
|
|
- `type` - 资源类型
|
||
|
|
|
||
|
|
**返回:** 对应的加载器指针,未找到则返回 `nullptr`
|
||
|
|
|
||
|
|
**复杂度:** O(1)
|
||
|
|
|
||
|
|
**示例:**
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
IResourceLoader* texLoader = ResourceManager::Get().GetLoader(ResourceType::Texture);
|
||
|
|
if (texLoader) {
|
||
|
|
auto extensions = texLoader->GetSupportedExtensions();
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
## 相关文档
|
||
|
|
|
||
|
|
- [ResourceManager 总览](resourcemanager.md) - 返回类总览
|