Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetExternalObjectMap()

Gets a copy of the external object map used by the AssetImporter.
Read time 1 minuteLast updated 7 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
public Dictionary<AssetImporter.SourceAssetIdentifier, Object> GetExternalObjectMap()

Returns

Type

Description

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

Remarks

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

Examples

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."); } }}