docs: update resources API docs
This commit is contained in:
38
docs/api/resources/mesh/get-path.md
Normal file
38
docs/api/resources/mesh/get-path.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# Mesh::GetPath
|
||||
|
||||
```cpp
|
||||
const Containers::String& GetPath() const override;
|
||||
```
|
||||
|
||||
返回网格资源的路径。路径用于资源定位和唯一标识。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** `const Containers::String&` - 资源路径的引用
|
||||
|
||||
**异常:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Resources/Mesh.h"
|
||||
|
||||
using namespace XCEngine::Resources;
|
||||
|
||||
Mesh mesh;
|
||||
IResource::ConstructParams params;
|
||||
params.name = "Character_Hero";
|
||||
params.path = "assets/meshes/hero.mesh";
|
||||
params.guid = ResourceGUID::Generate(params.path);
|
||||
mesh.Initialize(params);
|
||||
|
||||
const String& path = mesh.GetPath();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [类总览](mesh.md) - 返回类总览
|
||||
Reference in New Issue
Block a user