docs: Remove sub-headers from 公共方法 sections to follow SKILL.md规范

This commit is contained in:
2026-03-19 01:59:38 +08:00
parent b46d450429
commit 8e85fd98b8
13 changed files with 3 additions and 314 deletions

View File

@@ -18,102 +18,39 @@
## 公共方法
### 生命周期
| 方法 | 描述 |
|------|------|
| `void Initialize()` | 初始化资源管理器 |
| `void Shutdown()` | 关闭资源管理器,卸载所有资源 |
### 资源根目录
| 方法 | 描述 |
|------|------|
| `void SetResourceRoot(const Containers::String& rootPath)` | 设置资源根目录 |
| `const Containers::String& GetResourceRoot() const` | 获取资源根目录 |
### 同步加载
| 方法 | 描述 |
|------|------|
| `ResourceHandle<T> Load(const Containers::String& path, ImportSettings* settings = nullptr)` | 同步加载资源(模板方法) |
### 异步加载
| 方法 | 描述 |
|------|------|
| `void LoadAsync(const Containers::String& path, ResourceType type, std::function<void(LoadResult)> callback)` | 异步加载资源 |
| `void LoadAsync(const Containers::String& path, ResourceType type, ImportSettings* settings, std::function<void(LoadResult)> callback)` | 带设置的异步加载 |
### 批量加载
| 方法 | 描述 |
|------|------|
| `void LoadGroup(const Containers::Array<Containers::String>& paths, std::function<void(ResourceHandle<T>)> callback)` | 批量异步加载同类资源 |
### 卸载管理
| 方法 | 描述 |
|------|------|
| `void Unload(const Containers::String& path)` | 按路径卸载资源 |
| `void Unload(ResourceGUID guid)` | 按 GUID 卸载资源 |
| `void UnloadUnused()` | 卸载所有无引用的资源 |
| `void UnloadAll()` | 卸载所有资源 |
## 实现说明
**注意**: 以下方法当前为部分实现或 stub 状态:
- `UnloadUnused()` 为空实现
- `ReloadResource()` 为 stub
### 引用计数
| 方法 | 描述 |
|------|------|
| `void AddRef(ResourceGUID guid)` | 增加引用计数(内部使用) |
| `void Release(ResourceGUID guid)` | 减少引用计数(内部使用) |
| `Core::uint32 GetRefCount(ResourceGUID guid) const` | 获取引用计数 |
### 查找
| 方法 | 描述 |
|------|------|
| `IResource* Find(const Containers::String& path)` | 按路径查找资源 |
| `IResource* Find(ResourceGUID guid)` | 按 GUID 查找资源 |
| `bool Exists(const Containers::String& path) const` | 检查资源是否存在 |
| `bool Exists(ResourceGUID guid) const` | 检查 GUID 对应资源是否存在 |
### 加载器管理
| 方法 | 描述 |
|------|------|
| `void RegisterLoader(IResourceLoader* loader)` | 注册资源加载器 |
| `void UnregisterLoader(ResourceType type)` | 注销加载器 |
| `IResourceLoader* GetLoader(ResourceType type) const` | 获取指定类型的加载器 |
### 内存管理
| 方法 | 描述 |
|------|------|
| `void SetMemoryBudget(size_t bytes)` | 设置内存预算 |
| `size_t GetMemoryUsage() const` | 获取当前内存使用量 |
| `size_t GetMemoryBudget() const` | 获取内存预算 |
| `void FlushCache()` | 清空缓存 |
### 路径解析
| 方法 | 描述 |
|------|------|
| `Containers::String ResolvePath(const Containers::String& relativePath) const` | 将相对路径解析为绝对路径 |
### 资源信息
| 方法 | 描述 |
|------|------|
| `Containers::Array<Containers::String> GetResourcePaths() const` | 获取所有已加载资源的路径列表 |
| `void UnloadGroup(const Containers::Array<ResourceGUID>& guids)` | 按 GUID 批量卸载 |
## 使用示例
## 实现说明
```cpp
// 初始化