docs: update resources API docs
This commit is contained in:
29
docs/api/resources/iresource/getguid.md
Normal file
29
docs/api/resources/iresource/getguid.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# IResource::GetGUID
|
||||
|
||||
```cpp
|
||||
virtual ResourceGUID GetGUID() const = 0
|
||||
```
|
||||
|
||||
获取全局唯一标识符。纯虚方法,由具体资源类实现,返回资源的唯一 GUID。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** `ResourceGUID` - 资源的全局唯一标识符
|
||||
|
||||
**异常:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
ResourceHandle<Material> mat = ResourceManager::Get().Load<Material>("materials/player.mat");
|
||||
ResourceGUID guid = mat->GetGUID();
|
||||
// guid 是根据路径生成的唯一标识符
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [IResource 总览](iresource.md) - 返回类总览
|
||||
Reference in New Issue
Block a user