Add Content.GetEditorAssetPath
This commit is contained in:
@@ -235,6 +235,7 @@ bool AssetsCache::Save(const StringView& path, const Registry& entries, const Pa
|
||||
|
||||
const String& AssetsCache::GetEditorAssetPath(const Guid& id) const
|
||||
{
|
||||
ScopeLock lock(_locker);
|
||||
#if USE_EDITOR
|
||||
auto e = _registry.TryGet(id);
|
||||
return e ? e->Info.Path : String::Empty;
|
||||
|
||||
@@ -320,6 +320,11 @@ bool Content::GetAssetInfo(const StringView& path, AssetInfo& info)
|
||||
#endif
|
||||
}
|
||||
|
||||
String Content::GetEditorAssetPath(const Guid& id)
|
||||
{
|
||||
return Cache.GetEditorAssetPath(id);
|
||||
}
|
||||
|
||||
Array<Guid> Content::GetAllAssets()
|
||||
{
|
||||
Array<Guid> result;
|
||||
|
||||
@@ -70,6 +70,13 @@ public:
|
||||
/// <returns>True if found any asset, otherwise false.</returns>
|
||||
API_FUNCTION() static bool GetAssetInfo(const StringView& path, API_PARAM(Out) AssetInfo& info);
|
||||
|
||||
/// <summary>
|
||||
/// Finds the asset path by id. In editor it returns the actual asset path, at runtime it returns the mapped asset path.
|
||||
/// </summary>
|
||||
/// <param name="id">The asset id.</param>
|
||||
/// <returns>The asset path, or empty if failed to find.</returns>
|
||||
API_FUNCTION() static String GetEditorAssetPath(const Guid& id);
|
||||
|
||||
/// <summary>
|
||||
/// Finds all the asset IDs. Uses asset registry.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user