Add option *Show asset references graph* to content context menu

This commit is contained in:
Wojtek Figat
2021-10-08 16:18:16 +02:00
parent 5a35c4ad74
commit b3764d1e70
4 changed files with 443 additions and 0 deletions

View File

@@ -122,6 +122,21 @@ String Scene::GetDataFolderPath() const
return Globals::ProjectContentFolder / TEXT("SceneData") / GetFilename();
}
Array<Guid> Scene::GetAssetReferences() const
{
Array<Guid> result;
const auto asset = Content::Load<SceneAsset>(GetID());
if (asset)
{
asset->GetReferences(result);
}
else
{
// TODO: serialize scene to json and collect refs
}
return result;
}
#endif
MeshCollider* Scene::TryGetCsgCollider()

View File

@@ -110,6 +110,13 @@ public:
/// </summary>
API_PROPERTY() String GetDataFolderPath() const;
/// <summary>
/// Gets the asset references (scene asset). Supported only in Editor.
/// </summary>
/// <seealso cref="Asset.GetReferences"/>
/// <returns>The collection of the asset ids referenced by this asset.</returns>
API_FUNCTION() Array<Guid, HeapAllocation> GetAssetReferences() const;
#endif
private: