docs: update resources API docs
This commit is contained in:
30
docs/api/resources/resourcepath/toguid.md
Normal file
30
docs/api/resources/resourcepath/toguid.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# ResourcePath::ToGUID
|
||||
|
||||
```cpp
|
||||
ResourceGUID ToGUID() const
|
||||
```
|
||||
|
||||
将路径转换为 GUID。
|
||||
|
||||
**详细描述:**
|
||||
|
||||
通过 `ResourceGUID::Generate` 方法根据路径字符串生成唯一的资源标识符。
|
||||
|
||||
**返回:** `ResourceGUID`,基于路径生成的全局唯一标识符
|
||||
|
||||
**复杂度:** O(n),取决于 `ResourceGUID::Generate` 实现
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
ResourcePath path("textures/player.png");
|
||||
ResourceGUID guid = path.ToGUID();
|
||||
|
||||
// GUID 可用于资源查找、缓存键等
|
||||
ResourceHandle<Texture> tex = ResourceManager::Get().Find(guid);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [ResourcePath 总览](resourcepath.md) - 返回类总览
|
||||
- [ResourceTypes](../resourcetypes/resourcetypes.md) - 资源类型定义
|
||||
Reference in New Issue
Block a user