Files
XCEngine/docs/api/resources/resource-dependency-graph/remove-dependency.md

35 lines
772 B
Markdown

# RemoveDependency
移除资源之间的依赖关系。
## 方法签名
```cpp
void RemoveDependency(ResourceGUID owner, ResourceGUID dependency);
```
## 详细描述
移除两个节点之间的依赖关系。该方法会同时更新两个节点的关联数组:
-`owner``dependencies` 列表中移除 `dependency`
-`dependency``dependents` 列表中移除 `owner`
如果任一节点不存在或依赖关系不存在,则不做任何操作。
## 参数
| 参数 | 类型 | 描述 |
|------|------|------|
| `owner` | `ResourceGUID` | 依赖方的全局唯一标识符 |
| `dependency` | `ResourceGUID` | 被依赖项的全局唯一标识符 |
## 返回值
## 示例
```cpp
graph.RemoveDependency("material"_guid, "texture"_guid);
```