# HasNode 检查节点是否存在。 ## 方法签名 ```cpp bool HasNode(ResourceGUID guid) const; ``` ## 详细描述 检查指定资源节点是否存在于依赖图中。这是在添加依赖关系前验证节点是否存在的常用方法。 ## 参数 | 参数 | 类型 | 描述 | |------|------|------| | `guid` | `ResourceGUID` | 要检查的资源的全局唯一标识符 | ## 返回值 `bool` - 如果节点存在返回 `true`,否则返回 `false` ## 示例 ```cpp graph.AddNode("texture"_guid, ResourceType::Texture); bool exists = graph.HasNode("texture"_guid); // 返回 true bool notExists = graph.HasNode("unknown"_guid); // 返回 false ```