Files
XCEngine/docs/api/resources/iresource/getpath.md

629 B

IResource::GetPath

virtual const Containers::String& GetPath() const = 0

获取资源路径。纯虚方法,由具体资源类实现,返回资源在文件系统中的相对路径。

参数:

返回: const Containers::String& - 资源路径的常量引用

异常:

线程安全:

复杂度: O(1)

示例:

ResourceHandle<Texture> tex = ResourceManager::Get().Load<Texture>("textures/player.png");
const Containers::String& path = tex->GetPath();
// path == "textures/player.png"

相关文档