docs: update resources API docs
This commit is contained in:
38
docs/api/resources/mesh/get-name.md
Normal file
38
docs/api/resources/mesh/get-name.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# Mesh::GetName
|
||||
|
||||
```cpp
|
||||
const Containers::String& GetName() const override;
|
||||
```
|
||||
|
||||
返回网格资源的名称。名称在资源创建时通过 `IResource::Initialize` 方法设置。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** `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& name = mesh.GetName();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [类总览](mesh.md) - 返回类总览
|
||||
Reference in New Issue
Block a user