docs: update resources API docs
This commit is contained in:
26
docs/api/resources/material/is-valid.md
Normal file
26
docs/api/resources/material/is-valid.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Material::IsValid
|
||||
|
||||
```cpp
|
||||
bool IsValid() const override;
|
||||
```
|
||||
|
||||
检查材质是否有效且已正确加载。
|
||||
|
||||
**返回:** 材质有效返回 true,否则返回 false
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
ResourceHandle<Material> mat = ResourceManager::Get().Load<Material>("materials/pbr.mat");
|
||||
if (mat->IsValid()) {
|
||||
// 材质已成功加载
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Material](material.md) - 返回类总览
|
||||
Reference in New Issue
Block a user