Version: Unity 6.3 LTS (6000.3)
LanguageEnglish
  • C#

AssetImporter.GetExternalObjectMap

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public Dictionary<SourceAssetIdentifier,Object> GetExternalObjectMap();

Returns

Dictionary<SourceAssetIdentifier,Object> The map between a sub-asset and an external Asset.

Description

Gets a copy of the external object map used by the AssetImporter.

Changing the map does not affect the state of the AssetImporter.

Additional resources: AssetImporter.AddRemap, AssetImporter.RemoveRemap.

using UnityEditor;
using UnityEngine;

public class GetExternalObjectMapExample { [MenuItem("Tools/GetExternalObjectMapExample")] static void Example() { var importer = AssetImporter.GetAtPath("Path/To/Your/Asset"); //Get external object map from asset pack importer var externalObjectMap = importer.GetExternalObjectMap(); //Log each external reference if any exist; otherwise, report that none are present if (externalObjectMap.Count > 0) { foreach (var map in externalObjectMap) { Debug.Log($"{map.Value} path: {map.Key} in asset pack importer at path: {importer.assetPath}"); } } else { Debug.Log("No external object map found for the specified asset pack importer."); } } }