docs: refactor Components API content

This commit is contained in:
2026-03-27 16:15:00 +08:00
parent f0d6d4f41c
commit 9e66a81514
16 changed files with 1611 additions and 381 deletions

View File

@@ -0,0 +1,28 @@
# GetMaterialPath
**所属类型**: [MeshRendererComponent](MeshRendererComponent.md)
## 签名
```cpp
const std::string& GetMaterialPath(size_t index) const;
```
## 作用
返回指定材质槽当前记录的资源路径字符串。
## 当前实现行为
- 如果 `index` 在范围内,返回 `m_materialPaths[index]`
- 如果越界,返回一个静态空字符串引用,而不是抛异常。
## 使用建议
这个接口更适合做编辑器显示、序列化检查和路径级调试;真正的运行时材质对象访问仍应优先看 [GetMaterial](GetMaterial.md) 或 [GetMaterialHandle](GetMaterialHandle.md)。
## 相关文档
- [MeshRendererComponent](MeshRendererComponent.md)
- [GetMaterial](GetMaterial.md)
- [SetMaterialPath](SetMaterialPath.md)