docs: update resources API docs

This commit is contained in:
2026-03-20 02:35:35 +08:00
parent fd792b7df1
commit ea756c0177
314 changed files with 9439 additions and 1360 deletions

View File

@@ -0,0 +1,31 @@
# MaterialLoader::CanLoad
## 方法签名
```cpp
bool CanLoad(const Containers::String& path) const override;
```
## 详细描述
检查给定路径的文件是否可以被该加载器加载。通过提取文件扩展名并与支持列表进行比较来判断。
## 参数
| 参数 | 类型 | 描述 |
|------|------|------|
| path | `const Containers::String&` | 待检查的文件路径 |
## 返回值
`bool` - 如果文件扩展名在支持列表中返回 `true`,否则返回 `false`
## 示例
```cpp
MaterialLoader loader;
bool canLoad1 = loader.CanLoad("assets/materials/wood.mat"); // true
bool canLoad2 = loader.CanLoad("assets/materials/wood.material"); // true
bool canLoad3 = loader.CanLoad("assets/materials/wood.json"); // true
bool canLoad4 = loader.CanLoad("assets/materials/wood.png"); // false
```