| Parameter | Description |
|---|---|
| obj | The object of the asset. |
| entityId | The EntityID of the asset. |
| instanceID | The InstanceID of the asset. |
bool Returns true if the asset is a foreign asset, and false otherwise.
Determines whether a given asset is an external asset, also known as a foreign asset.
A foreign asset is any asset that isn't created within Unity, for example a .png texture file. An asset created in Unity is a native asset, for example a material or a prefab.
Unity creates a serialized representation of foreign assets in the Project's Library folder during import. This happens when the asset is first added, when it's updated externally, or when you modify its import settings in the Editor.
Additional resources: AssetDatabase.IsNativeAsset.
using UnityEditor; using UnityEngine;
public class AssetDatabaseExamples : MonoBehaviour { [MenuItem("AssetDatabase/Find Foreign Assets")] static void FindForeignAssets() { //Find all foreign assets foreach (var guid in AssetDatabase.FindAssets("",new []{"Assets"})) { var path = AssetDatabase.GUIDToAssetPath(guid); var asset = AssetDatabase.LoadMainAssetAtPath(path); var assetIsForeign = AssetDatabase.IsForeignAsset(asset); if(assetIsForeign) Debug.Log(asset); } } }