docs: refactor Components API content
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user